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.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.yml')
-rw-r--r-- | docker-compose.yml | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index 47786ec..18d60b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,28 +1,30 @@ -# 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: mysql:5.7 + volumes: + - ./tools/docker/db/data:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_USER=patchwork + - MYSQL_PASSWORD=password -db: - image: mysql:5.7 - volumes: - - ./tools/docker/db/data:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=password - - MYSQL_USER=patchwork - - MYSQL_PASSWORD=password - -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: - - PW_TEST_DB_HOST=db - - PW_TEST_DB_PORT=3306 + 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 + - PW_TEST_DB_HOST=db + - PW_TEST_DB_PORT=3306 |