From 5c8fc915382c526577a3aab0fbf47faa630fd21c Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Sun, 2 Feb 2020 14:14:27 -0800 Subject: [PATCH] Update Docker deployment documentation (#106) --- .gitignore | 3 ++ README.md | 28 +++++++++++++------ ...-compose.yml => docker-compose.example.yml | 6 ---- 3 files changed, 22 insertions(+), 15 deletions(-) rename docker-compose.yml => docker-compose.example.yml (87%) diff --git a/.gitignore b/.gitignore index 03632ed6..11e3aa9e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,10 @@ # Environment files. .env + +# Docker deployment files. docker.env +docker-compose.yml # IDE configuration files. /.idea diff --git a/README.md b/README.md index e1230e00..79e9827e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,10 @@ for detailed information. cd babybuddy -1. Set the `SECRET_KEY` and `TIME_ZONE` values in `.ebextensions/babybuddy.config` +1. Set (at least) the `SECRET_KEY` environment value in `.ebextensions/babybuddy.config` + + *See [Configuration](#configuration) for other settings that can be + controlled by environment variables. 1. [Create an IAM user](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) in AWS with EB, EC2, RDS and S3 privileges. @@ -78,18 +81,25 @@ redeploy the app (e.g. if there are errors or settings are changed). ### Docker -A Docker deployment requires [Docker](https://www.docker.com/) and -[Docker Compose](https://docs.docker.com/compose/) to create two containers - -one for the database and one for the application. +A Docker deployment requires [Docker Engine](https://www.docker.com/) v18.06.0+ +and [Docker Compose](https://docs.docker.com/compose/) v1.22.0+ to create two +containers: one for the database and one for the application. This process ues +two files, `docker.env` and `docker-compose.yml` to set up the application from +the [cdubzzz/babybuddy](https://hub.docker.com/r/cdubzzz/babybuddy) image on +Docker Hub. -1. Copy the `docker.env.example` to `docker.env` and set the `ALLOWED_HOSTS` and -`SECRET_KEY` variables +The example files provided in this repository (`docker.env.example` and +`docker-compose.example.yml`) are intended for production deployments. Those two +files are all that is needed for a Docker deployment of Baby Buddy. - cp docker.env.example docker.env - editor docker.env +1. Copy the contents of `docker.env.example` as `docker.env` and set the +`ALLOWED_HOSTS` and `SECRET_KEY` variables (at least). *See [Configuration](#configuration) for other settings that can be - controlled by environment variables added to the `docker.env` file.* + controlled by environment variables.* + +1. Copy the contents of `docker-compose.example.yml` as `docker-compose.yml` in +the same directory as the `docker.env` file from step 1. 1. Build/run the application diff --git a/docker-compose.yml b/docker-compose.example.yml similarity index 87% rename from docker-compose.yml rename to docker-compose.example.yml index 979baf48..9c0fea72 100644 --- a/docker-compose.yml +++ b/docker-compose.example.yml @@ -1,6 +1,4 @@ ---- version: "3.7" - services: db: image: postgres @@ -17,9 +15,5 @@ services: - "8000:8000" depends_on: - db - volumes: - - app:/app:rw - volumes: - app: {} db: {}