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
|
|
|
|
2023-02-21 16:43:46 +13:00
|
|
|
x-django: &django
|
|
|
|
image: right-tree
|
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
2023-03-28 13:00:15 +13:00
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
2023-02-21 16:43:46 +13:00
|
|
|
env_file: .env
|
|
|
|
user: "$UID:$GID"
|
|
|
|
restart: always
|
|
|
|
|
2021-11-10 17:21:57 +13:00
|
|
|
services:
|
2021-11-16 17:30:40 +13:00
|
|
|
backend:
|
2023-02-21 16:43:46 +13:00
|
|
|
<<: *django
|
2021-11-16 17:30:40 +13:00
|
|
|
container_name: backend
|
2023-02-21 16:43:46 +13:00
|
|
|
expose:
|
|
|
|
- "8000"
|
|
|
|
command:
|
|
|
|
- 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
|
2021-12-20 11:48:23 +13:00
|
|
|
restart: always
|
2021-11-16 17:30:40 +13:00
|
|
|
image: nginx
|
|
|
|
depends_on:
|
|
|
|
- backend
|
|
|
|
volumes:
|
2023-03-28 13:00:15 +13:00
|
|
|
- ./nginx.production.conf:/etc/nginx/nginx.conf:ro
|
|
|
|
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles:ro
|
|
|
|
- ./frontend/build:/etc/nginx/html/build:ro
|
|
|
|
- /etc/letsencrypt:/etc/letsencrypt:ro
|
2021-11-10 17:21:57 +13:00
|
|
|
ports:
|
2021-11-23 15:32:13 +13:00
|
|
|
- "80:80"
|
2021-11-29 10:16:24 +13:00
|
|
|
- "443:443"
|
2021-11-10 17:21:57 +13:00
|
|
|
|
|
|
|
postgres:
|
2023-02-21 16:43:46 +13:00
|
|
|
image: postgis/postgis:13-3.1
|
2021-12-20 11:48:23 +13:00
|
|
|
restart: always
|
2021-11-10 17:21:57 +13:00
|
|
|
container_name: postgres
|
|
|
|
volumes:
|
2021-11-16 17:30:40 +13:00
|
|
|
- righttree-postgres-data:/var/lib/postgresql/data
|
2023-03-28 13:00:15 +13:00
|
|
|
expose:
|
|
|
|
- "5432"
|
2021-11-10 17:21:57 +13:00
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=${POSTGRES_DB}
|
|
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
2023-02-21 16:43:46 +13:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "pg_isready", "--dbname", "righttree", "--username", "righttree"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2021-11-10 17:21:57 +13:00
|
|
|
|
2023-02-21 16:43:46 +13:00
|
|
|
redis:
|
|
|
|
image: redis:7.0.8
|
|
|
|
restart: always
|
|
|
|
container_name: redis
|
|
|
|
expose:
|
|
|
|
- "6379"
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
celery:
|
|
|
|
<<: *django
|
|
|
|
container_name: celery
|
|
|
|
command:
|
|
|
|
- celery
|
|
|
|
- -A
|
|
|
|
- right_tree.api
|
|
|
|
- worker
|
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|