diff options
author | Stephen Finucane <stephen@that.guru> | 2018-04-17 09:58:00 +0100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2018-04-26 10:47:02 +0100 |
commit | 98abeada054c4573bba9dcb20091df21304a598e (patch) | |
tree | b66b0e4b1de74d78b529895b2e9fe6afaaf8f098 /docker-compose-pg.yml | |
parent | 7484a8c044565ac8e683efdddfd726a5ecdc542a (diff) | |
download | patchwork-98abeada054c4573bba9dcb20091df21304a598e.tar patchwork-98abeada054c4573bba9dcb20091df21304a598e.tar.gz |
docker-compose: Switch to 3.0 syntax
Ubuntu 18.04 (Bionic Beaver) providers 'docker-compose' 1.17.1 [1] at
release which supports the 3.0 syntax [2]. Using this allows some users
(me) to resolve a long standing issue caused by a UID that's not 1000.
[1] https://packages.ubuntu.com/bionic/docker-compose
[2] https://docs.docker.com/compose/compose-file/
Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'docker-compose-pg.yml')
-rw-r--r-- | docker-compose-pg.yml | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/docker-compose-pg.yml b/docker-compose-pg.yml index 81dde3e..e403547 100644 --- a/docker-compose-pg.yml +++ b/docker-compose-pg.yml @@ -1,30 +1,32 @@ -# the version of docker-compose shipped in ubuntu 16.04 is -# 1.5.2, which doesn't support version 2 syntax. Yay! -# also, v1 doesn't support explicit build args, so if you're not -# uid 1000, you will either need to manually hack the Dockerfile -# or upgrade to v2 and use the build-arg to override it. +version: "3" +services: + db: + image: postgres:9.6 + volumes: + - ./tools/docker/db/postdata:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=password -db: - image: postgres:9.6 - environment: - - POSTGRES_PASSWORD=password - volumes: - - ./tools/docker/db/postdata:/var/lib/postgresql/data - -web: - build: . - dockerfile: ./tools/docker/Dockerfile - command: python3 manage.py runserver 0.0.0.0:8000 - volumes: - - .:/home/patchwork/patchwork/ - ports: - - "8000:8000" - links: - - db - environment: - - PGPASSWORD=password - - PW_TEST_DB_HOST=db - - PW_TEST_DB_PORT=5432 - - PW_TEST_DB_TYPE=postgres - - PW_TEST_DB_USER=postgres - - PW_TEST_DB_PASS=password + web: + build: + context: . + dockerfile: ./tools/docker/Dockerfile + args: + - UID + command: python3 manage.py runserver 0.0.0.0:8000 + volumes: + - .:/home/patchwork/patchwork/ + ports: + - "8000:8000" + # TODO(stephenfin): links are deprecated and should be replaced + # with user-defined networks + links: + - db + environment: + - UID + - PGPASSWORD=password + - PW_TEST_DB_HOST=db + - PW_TEST_DB_PORT=5432 + - PW_TEST_DB_TYPE=postgres + - PW_TEST_DB_USER=postgres + - PW_TEST_DB_PASS=password |