Move environment variables to example Docker Compose file (#110)

This commit is contained in:
Christopher C. Wells 2020-02-04 11:30:19 -08:00
parent 8e5364d891
commit 5b24ff21b6
3 changed files with 15 additions and 20 deletions

View File

@ -83,24 +83,20 @@ redeploy the app (e.g. if there are errors or settings are changed).
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.
containers: one for the database and one for the application.
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.
The example `docker-compose.example.yml` file provided in this repository is
intended for production deployments. Baby Buddy is deployed to Docker Hub as
[cdubzzz/babybuddy](https://hub.docker.com/r/cdubzzz/babybuddy) so this is the
only file needed for a Docker deployment with Docker Compose.
1. Copy the contents of `docker.env.example` as `docker.env` and set the
`ALLOWED_HOSTS` and `SECRET_KEY` variables (at least).
1. Copy the contents of `docker-compose.example.yml` as `docker-compose.yml`
and set, at least, the `ALLOWED_HOSTS` and `SECRET_KEY` variables under
`services:app:environment`.
*See [Configuration](#configuration) for other settings that can be
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
docker-compose up -d

View File

@ -8,8 +8,13 @@ services:
- db:/db-data:rw
app:
image: cdubzzz/babybuddy
env_file:
- docker.env
# See README.md#configuration for other environment configuration options.
environment:
- ALLOWED_HOSTS=
- DEBUG=False
- DJANGO_SETTINGS_MODULE=babybuddy.settings.docker
- SECRET_KEY=
- TIME_ZONE=
command: gunicorn -c /app/gunicorn.py babybuddy.wsgi
ports:
- "8000:8000"

View File

@ -1,6 +0,0 @@
# See README.md#configuration for other configuration options.
ALLOWED_HOSTS=
DEBUG=False
DJANGO_SETTINGS_MODULE=babybuddy.settings.docker
SECRET_KEY=