---
version: '3.2'
services:
postgresql:
image: postgres
volumes:
- database:/var/lib/postgresql/data
networks:
- internal
environment:
- POSTGRES_PASSWORD=${PG_PASS:-thisisnotagoodpassword}
- POSTGRES_USER=passbook
- POSTGRES_DB=passbook
labels:
- traefik.enable=false
redis:
image: redis
database-migrate:
build:
context: .
image: docker.beryju.org/passbook/server:${TAG:-test}
command:
- ./manage.py
- migrate
restart: 'no'
- PASSBOOK_REDIS__HOST=redis
- PASSBOOK_POSTGRESQL__HOST=postgresql
- PASSBOOK_POSTGRESQL__PASSWORD=${PG_PASS:-thisisnotagoodpassword}
server:
- uwsgi
- uwsgi.ini
ports:
- 8000
- traefik.port=8000
- traefik.docker.network=internal
- traefik.frontend.rule=PathPrefix:/
worker:
- worker
static:
dockerfile: static.Dockerfile
image: docker.beryju.org/passbook/static:${TAG:-test}
- traefik.frontend.rule=PathPrefix:/static, /robots.txt
- traefik.port=80
traefik:
image: traefik:1.7
command: --api --docker
- /var/run/docker.sock:/var/run/docker.sock:ro
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "0.0.0.0:8080:8080"
database:
driver: local
internal: {}