2021-01-06 05:05:16 +00:00
|
|
|
version: "2.4"
|
2017-11-24 14:09:43 +00:00
|
|
|
services:
|
|
|
|
db:
|
2021-01-06 05:05:16 +00:00
|
|
|
image: postgres:11 # pin postgres to a major version
|
|
|
|
container_name: babybuddydb # Container_name is an optional value for single-container
|
|
|
|
# deployments to set a friendly container name.
|
|
|
|
# Disable in swarm or other multi-container setups.
|
2018-06-13 13:07:36 +00:00
|
|
|
environment:
|
2019-10-04 08:50:41 +00:00
|
|
|
- PGDATA=/db-data
|
2021-01-06 05:05:16 +00:00
|
|
|
- POSTGRES_PASSWORD=postgres # must correspond with DB_PASSWORD in APP
|
2018-06-13 13:07:36 +00:00
|
|
|
volumes:
|
2019-10-04 09:46:02 +00:00
|
|
|
- db:/db-data:rw
|
2021-01-06 05:05:16 +00:00
|
|
|
restart: unless-stopped
|
2017-11-26 19:02:57 +00:00
|
|
|
app:
|
2020-02-07 19:55:36 +00:00
|
|
|
image: babybuddy/babybuddy
|
2021-01-06 05:05:16 +00:00
|
|
|
container_name: babybuddyapp # Container_name is an optional value for single-container
|
|
|
|
# deployments to set a friendly container name.
|
|
|
|
# Disable in swarm or other multi-container setups.
|
2020-02-04 19:30:19 +00:00
|
|
|
# See README.md#configuration for other environment configuration options.
|
|
|
|
environment:
|
2021-01-06 05:05:16 +00:00
|
|
|
- ALLOWED_HOSTS=localhost # comma separated list of IP addresses or hosts that can access the web UI
|
|
|
|
- DB_PASSWORD=postgres # must correspond with POSTGRES_PASSWORD in DB
|
2020-02-04 19:30:19 +00:00
|
|
|
- DJANGO_SETTINGS_MODULE=babybuddy.settings.docker
|
2021-01-06 05:05:16 +00:00
|
|
|
- SECRET_KEY= # Generate a random string here to secure the Django instance
|
|
|
|
- TIME_ZONE= # In the tzdata format, IE, "America/Denver"
|
|
|
|
- DEBUG=False # Turn to False in production
|
2020-02-09 04:22:36 +00:00
|
|
|
volumes:
|
|
|
|
- media:/app/media:rw
|
2020-04-18 16:28:51 +00:00
|
|
|
# Sleep 5 seconds to allow the db to to come up;
|
2021-06-25 18:52:34 +00:00
|
|
|
command: |-
|
|
|
|
bash -c 'python manage.py migrate --noinput &&
|
|
|
|
python manage.py createcachetable &&
|
|
|
|
gunicorn babybuddy.wsgi -b :8000 --log-level=info \
|
|
|
|
--worker-tmp-dir=/dev/shm --log-file=- \
|
|
|
|
--workers=2 --threads=4 --worker-class=gthread'
|
2017-11-24 14:09:43 +00:00
|
|
|
ports:
|
2021-01-06 05:05:16 +00:00
|
|
|
- "8000:8000" # For Portainer, select another port for babybuddy such as 7000, for example "7000:8000"
|
|
|
|
restart: unless-stopped
|
2017-11-24 14:09:43 +00:00
|
|
|
depends_on:
|
2018-06-13 13:07:36 +00:00
|
|
|
- db
|
|
|
|
volumes:
|
2019-10-04 09:46:02 +00:00
|
|
|
db: {}
|
2020-02-09 04:22:36 +00:00
|
|
|
media: {}
|