right-tree/docker-compose.production.yaml

50 lines
1.1 KiB
YAML
Raw Normal View History

version: "3.8"
volumes:
2021-11-16 17:30:40 +13:00
righttree-postgres-data:
name: righttree-postgres-data
services:
2021-11-16 17:30:40 +13:00
backend:
restart: unless-stopped
build:
context: backend
dockerfile: Dockerfile
2021-11-16 17:30:40 +13:00
container_name: backend
depends_on:
- postgres
2021-11-16 17:30:40 +13:00
env_file: .env
ports:
- "8000:8000"
2021-11-16 17:30:40 +13:00
command: bash -c "gunicorn --bind 0.0.0.0:8000 right_tree.wsgi"
2021-11-16 17:30:40 +13:00
nginx:
container_name: nginx
image: nginx
depends_on:
- postgres
- backend
volumes:
2021-11-29 10:16:24 +13:00
- ./nginx.production.conf:/etc/nginx/nginx.conf
2021-11-16 17:30:40 +13:00
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles
- ./frontend/build:/etc/nginx/html/build
2021-11-29 10:16:24 +13:00
- /etc/letsencrypt:/etc/letsencrypt
ports:
- "80:80"
2021-11-29 10:16:24 +13:00
- "443:443"
postgres:
image: postgis/postgis:13-3.0
restart: unless-stopped
container_name: postgres
volumes:
2021-11-16 17:30:40 +13:00
- righttree-postgres-data:/var/lib/postgresql/data
- ./create_database.sql:/docker-entrypoint-initdb.d/create_database.sql
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}