2021-11-10 17:21:57 +13:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
volumes:
|
2021-11-16 17:30:40 +13:00
|
|
|
righttree-postgres-data:
|
|
|
|
name: righttree-postgres-data
|
2021-11-10 17:21:57 +13:00
|
|
|
|
|
|
|
services:
|
2021-11-16 17:30:40 +13:00
|
|
|
backend:
|
2021-11-10 17:21:57 +13:00
|
|
|
restart: unless-stopped
|
|
|
|
build:
|
|
|
|
context: backend
|
|
|
|
dockerfile: Dockerfile
|
2021-11-16 17:30:40 +13:00
|
|
|
container_name: backend
|
2021-11-10 17:21:57 +13:00
|
|
|
depends_on:
|
|
|
|
- postgres
|
2021-11-16 17:30:40 +13:00
|
|
|
env_file: .env
|
2021-11-10 17:21:57 +13:00
|
|
|
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-10 17:21:57 +13:00
|
|
|
|
2021-11-16 17:30:40 +13:00
|
|
|
nginx:
|
|
|
|
container_name: nginx
|
|
|
|
image: nginx
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
|
|
|
- backend
|
|
|
|
volumes:
|
|
|
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
|
|
|
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles
|
|
|
|
- ./frontend/build:/etc/nginx/html/build
|
|
|
|
- ./keys:/etc/ssl/private/nginx
|
2021-11-10 17:21:57 +13:00
|
|
|
ports:
|
2021-11-16 17:30:40 +13:00
|
|
|
- "9000:80"
|
2021-11-10 17:21:57 +13:00
|
|
|
|
|
|
|
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
|
2021-11-10 17:21:57 +13:00
|
|
|
- ./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}
|
|
|
|
|