From 754894e5d5ad1d7aae06c3c888a1816b235f34a8 Mon Sep 17 00:00:00 2001 From: Rich Wareham Date: Mon, 4 Sep 2017 13:48:17 +0100 Subject: [PATCH 1/2] docker-compose.yml: remove volume declaration When using docker-machine as recommended in the README file, the instructions for getting started do not work since the web application container fails to start. That's because the default "local" driver for Docker volumes doesn't work directly with docker-machine (see [1] for a discussion of this). The existing Dockerfile already copies the web application files to the container and removing the volume configuration allows the web application to start. Database migration and initial user creation can then be performed. If the volume configuration is kept, the ``manage.py`` script cannot be found because the ``/code`` directory appears to be empty. The downside of this change is that changes to the local files will not be reflected until a ``docker-compose build web`` command is issued. Depending on how a local developer prefers to work, this may lead to confusion. [1] https://alexanderzeitler.com/articles/docker-machine-and-docker-compose-developer-workflows/ --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index accdd2d0..d49dc2a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,6 @@ db: web: build: . command: python manage.py runserver 0.0.0.0:8000 --settings=talks.settings_docker - volumes: - - .:/code ports: - "8000:8000" links: From c33f3907bdb40edf161fa27e8a61f55b66a23f1f Mon Sep 17 00:00:00 2001 From: Rich Wareham Date: Wed, 13 Sep 2017 16:00:52 +0100 Subject: [PATCH 2/2] README.md: add note on re-building Docker containers. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 184cf4f3..fc791058 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,11 @@ Go at the root of your project directory (probably `talks.ox`): docker-compose up After a few seconds (minutes if it is building the instance for the first time), you should be able to visit -in your web browser: `http://:8000` and visualise Oxford Talks. +in your web browser: `http://:8000` and visualise Oxford Talks. Note +that the source tree is *copied* into the container. If you make a change to the +source code, make sure to re-build the containers by adding ``--build`` to the +``docker-compose up`` command or explicitly re-build the ``web`` container via +``docker-compose build web``. If you have a user account (see below), the correct login page is `http://:8000/admin/login`, the `Login` link won't work.