README (2440B)
1 === Dockerizing the Exchange/Merchant === 2 3 This section shows how to run a "dockerized" exchange/merchant. 4 The exchange uses postgresql (container) and is served 5 by nginx (container). The merchant instead depends on exchange 6 (container) and postgresql (container). 7 8 The docker's tools needed are: docker, docker-compose, docker-machine. 9 Please refer to Docker's official documentation for their installation 10 instructions. 11 12 Before starting to build the exchange/merchant's image, make sure a 13 docker-machine instance is up and running. 14 15 1. Build the images. 16 17 <COMPONENT> is either 'exchange' or 'merchant', depending on what is 18 to be built. 19 20 From <THIS_REPO/docker/<COMPONENT>, give: 21 22 # NOTE for 'merchant' build: as default, the merchant is configured 23 # to work with the 'demo' exchange running at exchange.demo.taler.net. 24 # Nonetheless, edit (before building) the files 25 # <THIS_REPO>/docker/merchant/exchange_{pub,url}.txt, in case the merchant 26 # needs to work with any other exchange. 27 28 $ docker-compose build 29 30 2. Launch the service. 31 32 The following command launches the <COMPONENT> and all other services 33 it depends on. From the same directory as the previous step, issue: 34 35 $ docker-compose up 36 37 If everything worked as expected, you should see some live logging 38 from all the containers. 39 (Errors about existing roles/databases can be ignored.) 40 41 3. Test 42 43 Issue the following command to see if the <COMPONENT> has been 44 correctly installed and launched. 45 46 # Some 'greeting' message should be returned. Note, the 47 # service runs on port 80. 48 49 $ curl http://`docker-machine ip`/ 50 51 52 === How to use these images === 53 54 This section explains how to (1) build and (2) run individual 55 images -- that is often not useful to run services, as they need 56 to be "composed" in order to work properly. 57 58 (1) is done by: 59 60 $ docker build -t taler/base <THIS_REPO>/docker/base/ 61 $ docker build -t taler/exchange <THIS_REPO>/docker/exchange/ 62 63 Note that the value passed to option -t is completely arbitrary. 64 65 (2) is done by: 66 67 $ docker run -it taler/exchange 68 69 === How to destroy them === 70 71 Consider also the --no-cache option to force a rebuild. 72 73 $ docker build --no-cache <THIS_REPO>/docker/base 74 75 1. Stop all containers: 76 77 $ docker stop $(docker ps -a -q) 78 79 80 2. If necessary, remove all containers: 81 82 $ docker rm $(docker ps -a -q) 83 84 3. Remove images: 85 86 $ docker rmi -f $(docker images -q) 87 88 89 NOTE: for tripwire users, those commands are all defined 90 as aliases.