django-docker-test/docker-compose.yml

42 lines
807 B
YAML

version: '3'
services:
db:
container_name: postgresdb
image: postgres:latest
restart: always
env_file:
- project.env
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
web:
container_name: django
build: djangoproject/
command: >
gunicorn djangoproject.wsgi:application --bind 0.0.0.0:8000 --workers=4
env_file:
- project.env
expose:
- 8000
depends_on:
- db
volumes:
- staticfiles:/home/app/web/staticfiles
nginx:
container_name: nginx
image: nginx:mainline-alpine
restart: always
ports:
- 8888:80
volumes:
- ./nginx:/etc/nginx/conf.d
- staticfiles:/home/app/web/staticfiles
depends_on:
- web
volumes:
postgres-data:
staticfiles: