production with django admin template
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

This commit is contained in:
2026-07-12 22:44:03 +02:00
parent ac5f25a99c
commit 70151f1225
4 changed files with 124 additions and 93 deletions

101
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,101 @@
services:
db:
restart: unless-stopped
redis:
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: 004erpbackend
restart: unless-stopped
env_file:
- .env
environment:
DJANGO_SETTINGS_MODULE: core.settings.production
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers 3 --timeout 120
volumes:
- media_volume:/app/media
ports:
- "8001:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
worker:
build:
context: ./backend
dockerfile: Dockerfile
container_name: 004erpworker
restart: unless-stopped
env_file:
- .env
environment:
DEBUG: "False"
DJANGO_SETTINGS_MODULE: core.settings.production
command: celery -A core worker --loglevel=info
volumes:
- media_volume:/app/media
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
flower:
build:
context: ./backend
dockerfile: Dockerfile
container_name: 004erpflower
restart: unless-stopped
env_file:
- .env
environment:
DEBUG: "False"
DJANGO_SETTINGS_MODULE: core.settings.production
command: celery -A core flower --port=5555
ports:
- "5555:5555"
depends_on:
redis:
condition: service_started
worker:
condition: service_started
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: 004erpfrontend
restart: unless-stopped
environment:
NODE_ENV: production
PUBLIC_API_URL: ${PUBLIC_API_URL}
command: sh -c "npm run build && node ./dist/server/entry.mjs"
ports:
- "4321:4321"
depends_on:
backend:
condition: service_started
webhook:
build: /opt/erp/deploy-webhook
container_name: 004erpwebhook
restart: unless-stopped
environment:
WEBHOOK_SECRET: ${GITEA_WEBHOOK_SECRET}
ports:
- "9001:9001"
volumes:
- /opt/erp/app:/opt/erp/app
- /var/run/docker.sock:/var/run/docker.sock
volumes:
postgres_data:
redis_data:
media_volume:
external: true