13c8436d98
- backend changes to support physical and digital checkouts
118 lines
2.4 KiB
YAML
118 lines
2.4 KiB
YAML
version: "3.8"
|
|
|
|
volumes:
|
|
righttree-postgres-data:
|
|
name: righttree-postgres-data
|
|
|
|
x-django: &django
|
|
image: right-tree
|
|
volumes:
|
|
- ./backend:/app
|
|
env_file: .env
|
|
user: "$UID:$GID"
|
|
restart: unless-stopped
|
|
|
|
services:
|
|
|
|
backend:
|
|
<<: *django
|
|
container_name: backend
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
celery:
|
|
condition: service_healthy
|
|
expose:
|
|
- "8000"
|
|
command:
|
|
- gunicorn
|
|
- --reload
|
|
- --bind=0.0.0.0:8000
|
|
- --timeout=300
|
|
- right_tree.wsgi
|
|
|
|
frontend:
|
|
image: node:16-bullseye
|
|
restart: unless-stopped
|
|
container_name: frontend
|
|
volumes:
|
|
- ./frontend:/app
|
|
working_dir: /app
|
|
user: "$UID:$GID"
|
|
ports:
|
|
- 3000:3000
|
|
command:
|
|
- npm
|
|
- start
|
|
|
|
postgres:
|
|
image: postgis/postgis:13-3.1
|
|
restart: unless-stopped
|
|
container_name: postgres
|
|
volumes:
|
|
- righttree-postgres-data:/var/lib/postgresql/data
|
|
- ./create_database.sql:/docker-entrypoint-initdb.d/create_database.sql
|
|
ports:
|
|
- 5432:5432
|
|
environment:
|
|
POSTGRES_PASSWORD: postgres
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "--dbname", "$DATABASE_NAME", "--username", "$DATABASE_USER"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
nginx:
|
|
image: nginx
|
|
restart: unless-stopped
|
|
container_name: nginx
|
|
depends_on:
|
|
- backend
|
|
- frontend
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles:ro
|
|
ports:
|
|
- 80:80
|
|
|
|
redis:
|
|
image: redis:7.0.10
|
|
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
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command:
|
|
- celery
|
|
- -A
|
|
- right_tree.api
|
|
- worker
|
|
healthcheck:
|
|
test: ["CMD", "celery", "-A", "right_tree.api", "inspect", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1'
|