2021-10-06 14:06:55 +13:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
volumes:
|
2021-12-10 13:17:37 +13:00
|
|
|
righttree-postgres-data:
|
|
|
|
name: righttree-postgres-data
|
2021-10-06 14:06:55 +13:00
|
|
|
|
2023-02-21 16:43:46 +13:00
|
|
|
x-django: &django
|
|
|
|
image: right-tree
|
|
|
|
volumes:
|
|
|
|
- ./backend:/app
|
|
|
|
env_file: .env
|
|
|
|
user: "$UID:$GID"
|
|
|
|
restart: unless-stopped
|
2023-02-08 14:24:48 +13:00
|
|
|
|
2023-02-21 16:43:46 +13:00
|
|
|
services:
|
2023-03-30 14:27:56 +13:00
|
|
|
|
2021-11-16 17:30:40 +13:00
|
|
|
backend:
|
2023-02-21 16:43:46 +13:00
|
|
|
<<: *django
|
2021-11-25 10:22:51 +13:00
|
|
|
container_name: backend
|
2023-03-29 16:40:45 +13:00
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
celery:
|
|
|
|
condition: service_healthy
|
2023-02-08 14:24:48 +13:00
|
|
|
expose:
|
|
|
|
- "8000"
|
|
|
|
command:
|
|
|
|
- gunicorn
|
|
|
|
- --reload
|
|
|
|
- --bind=0.0.0.0:8000
|
|
|
|
- --timeout=300
|
|
|
|
- right_tree.wsgi
|
2021-10-06 14:06:55 +13:00
|
|
|
|
2021-11-16 17:30:40 +13:00
|
|
|
frontend:
|
2023-02-08 14:24:48 +13:00
|
|
|
image: node:16-bullseye
|
2021-10-06 14:06:55 +13:00
|
|
|
restart: unless-stopped
|
2021-11-25 10:22:51 +13:00
|
|
|
container_name: frontend
|
2021-10-06 14:06:55 +13:00
|
|
|
volumes:
|
|
|
|
- ./frontend:/app
|
|
|
|
working_dir: /app
|
2023-02-08 14:24:48 +13:00
|
|
|
user: "$UID:$GID"
|
2021-12-01 09:39:45 +13:00
|
|
|
ports:
|
2023-02-08 14:24:48 +13:00
|
|
|
- 3000:3000
|
|
|
|
command:
|
|
|
|
- npm
|
|
|
|
- start
|
2021-10-06 14:06:55 +13:00
|
|
|
|
|
|
|
postgres:
|
2023-02-08 14:24:48 +13:00
|
|
|
image: postgis/postgis:13-3.1
|
2021-10-06 14:06:55 +13:00
|
|
|
restart: unless-stopped
|
|
|
|
container_name: postgres
|
|
|
|
volumes:
|
2021-12-10 13:17:37 +13:00
|
|
|
- righttree-postgres-data:/var/lib/postgresql/data
|
2021-10-15 15:20:14 +13:00
|
|
|
- ./create_database.sql:/docker-entrypoint-initdb.d/create_database.sql
|
2021-10-06 14:06:55 +13:00
|
|
|
ports:
|
2023-02-08 14:24:48 +13:00
|
|
|
- 5432:5432
|
2021-10-06 14:06:55 +13:00
|
|
|
environment:
|
2023-02-08 14:24:48 +13:00
|
|
|
POSTGRES_PASSWORD: postgres
|
2023-02-21 16:43:46 +13:00
|
|
|
healthcheck:
|
2023-03-29 16:40:45 +13:00
|
|
|
test: ["CMD", "pg_isready", "--dbname", "$DATABASE_NAME", "--username", "$DATABASE_USER"]
|
2023-02-21 16:43:46 +13:00
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2021-11-25 10:22:51 +13:00
|
|
|
|
|
|
|
nginx:
|
2023-02-21 16:43:46 +13:00
|
|
|
image: nginx
|
2023-02-08 14:24:48 +13:00
|
|
|
restart: unless-stopped
|
2021-11-25 10:22:51 +13:00
|
|
|
container_name: nginx
|
|
|
|
depends_on:
|
|
|
|
- backend
|
|
|
|
- frontend
|
|
|
|
volumes:
|
2023-02-08 14:24:48 +13:00
|
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
|
|
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles:ro
|
2021-11-25 10:22:51 +13:00
|
|
|
ports:
|
2023-03-06 18:10:25 +13:00
|
|
|
- 80:80
|
2023-02-21 16:43:46 +13:00
|
|
|
|
|
|
|
redis:
|
2023-03-29 16:40:45 +13:00
|
|
|
image: redis:7.0.10
|
2023-02-21 16:43:46 +13:00
|
|
|
restart: unless-stopped
|
|
|
|
container_name: redis
|
2023-03-06 18:10:25 +13:00
|
|
|
volumes:
|
|
|
|
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro
|
|
|
|
command:
|
|
|
|
- redis-server
|
|
|
|
- /usr/local/etc/redis/redis.conf
|
2023-02-21 16:43:46 +13:00
|
|
|
expose:
|
|
|
|
- "6379"
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
celery:
|
|
|
|
<<: *django
|
|
|
|
container_name: celery
|
2023-03-29 16:40:45 +13:00
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
2023-02-21 16:43:46 +13:00
|
|
|
command:
|
|
|
|
- celery
|
|
|
|
- -A
|
|
|
|
- right_tree.api
|
|
|
|
- worker
|
2023-03-29 16:40:45 +13:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "celery", "-A", "right_tree.api", "inspect", "ping"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2023-02-21 16:43:46 +13:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|