right-tree/docker-compose.yaml

109 lines
2.1 KiB
YAML
Raw Normal View History

version: "3.8"
volumes:
righttree-postgres-data:
name: righttree-postgres-data
x-django: &django
image: right-tree
depends_on:
postgres:
condition: service_healthy
2023-03-28 13:00:15 +13:00
redis:
condition: service_healthy
volumes:
- ./backend:/app
env_file: .env
user: "$UID:$GID"
restart: unless-stopped
2023-02-08 14:24:48 +13:00
services:
2021-11-16 17:30:40 +13:00
backend:
<<: *django
container_name: backend
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-11-16 17:30:40 +13:00
frontend:
2023-02-08 14:24:48 +13:00
image: node:16-bullseye
restart: unless-stopped
container_name: frontend
volumes:
- ./frontend:/app
working_dir: /app
2023-02-08 14:24:48 +13:00
user: "$UID:$GID"
ports:
2023-02-08 14:24:48 +13:00
- 3000:3000
command:
- npm
- start
postgres:
2023-02-08 14:24:48 +13:00
image: postgis/postgis:13-3.1
restart: unless-stopped
container_name: postgres
volumes:
- 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
ports:
2023-02-08 14:24:48 +13:00
- 5432:5432
environment:
2023-02-08 14:24:48 +13:00
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "pg_isready", "--dbname", "righttree", "--username", "righttree"]
interval: 10s
timeout: 5s
retries: 5
nginx:
image: nginx
2023-02-08 14:24:48 +13:00
restart: unless-stopped
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
ports:
- 80:80
redis:
image: redis:7.0.8
restart: unless-stopped
container_name: redis
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro
command:
- redis-server
- /usr/local/etc/redis/redis.conf
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:
redis:
condition: service_healthy
deploy:
resources:
limits:
cpus: '1'