From 686c861928d1ea9e0cb3e08e6c0591e5d984c975 Mon Sep 17 00:00:00 2001 From: "Jonathan Leibiusky @xetorthio" Date: Thu, 18 May 2017 09:32:12 -0300 Subject: [PATCH] Create sessions volume and mount it in the PWD containers, instead of bind mounting a path from the host. Remove `pwd` folder which is unused because of the change above. --- docker-compose.yml | 10 +++++++--- pwd/.gitignore | 4 ---- 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 pwd/.gitignore diff --git a/docker-compose.yml b/docker-compose.yml index 52b883d..36f2f20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.2' services: haproxy: container_name: proxy @@ -15,12 +15,13 @@ services: # use the latest golang image image: golang # go to the right place and starts the app - command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save ./pwd/sessions1 -name pwd1 -cname host1' + command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save /pwd/sessions1 -name pwd1 -cname host1' volumes: # since this app creates networks and launches containers, we need to talk to docker daemon - /var/run/docker.sock:/var/run/docker.sock # mount the box mounted shared folder to the container - $GOPATH/src:/go/src + - sessions:/pwd environment: GOOGLE_RECAPTCHA_DISABLED: "true" pwd2: @@ -29,11 +30,14 @@ services: # use the latest golang image image: golang # go to the right place and starts the app - command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save ./pwd/sessions2 -name pwd2 -cname host2' + command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save /pwd/sessions2 -name pwd2 -cname host2' volumes: # since this app creates networks and launches containers, we need to talk to docker daemon - /var/run/docker.sock:/var/run/docker.sock # mount the box mounted shared folder to the container - $GOPATH/src:/go/src + - sessions:/pwd environment: GOOGLE_RECAPTCHA_DISABLED: "true" +volumes: + sessions: diff --git a/pwd/.gitignore b/pwd/.gitignore deleted file mode 100644 index 5e7d273..0000000 --- a/pwd/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore