mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-19 21:26:05 -05:00
137 lines
3.5 KiB
YAML
137 lines
3.5 KiB
YAML
version: "3.8"
|
|
|
|
# Development setup with hot-reload and file mounts
|
|
# This is the ONLY compose file that mounts the source code
|
|
|
|
services:
|
|
migrations:
|
|
build:
|
|
context: .
|
|
dockerfile: ./Dockerfile
|
|
target: base
|
|
args:
|
|
- DEVELOPMENT_MODE=True
|
|
image: mediacms/mediacms-dev:7.3
|
|
command: ["/bin/bash", "/home/mediacms.io/mediacms/scripts/run-migrations.sh"]
|
|
environment:
|
|
DEVELOPMENT_MODE: 'True'
|
|
DEBUG: 'True'
|
|
ADMIN_USER: 'admin'
|
|
ADMIN_EMAIL: 'admin@localhost'
|
|
ADMIN_PASSWORD: 'admin'
|
|
restart: "no"
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./:/home/mediacms.io/mediacms/
|
|
|
|
web:
|
|
image: mediacms/mediacms-dev:7.3
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:8000"
|
|
command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
|
environment:
|
|
DEVELOPMENT_MODE: 'True'
|
|
DEBUG: 'True'
|
|
depends_on:
|
|
migrations:
|
|
condition: service_completed_successfully
|
|
redis:
|
|
condition: service_healthy
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./:/home/mediacms.io/mediacms/
|
|
|
|
frontend:
|
|
image: node:20-alpine
|
|
working_dir: /home/mediacms.io/mediacms/frontend/
|
|
command: sh -c "npm install && npm run start"
|
|
ports:
|
|
- "8088:8088"
|
|
environment:
|
|
- NODE_ENV=development
|
|
env_file:
|
|
- ./frontend/.env
|
|
volumes:
|
|
- ./frontend:/home/mediacms.io/mediacms/frontend/
|
|
depends_on:
|
|
- web
|
|
|
|
celery_beat:
|
|
image: mediacms/mediacms-dev:7.3
|
|
restart: unless-stopped
|
|
command: ["/home/mediacms.io/bin/celery", "-A", "cms", "beat", "--loglevel=INFO"]
|
|
environment:
|
|
DEVELOPMENT_MODE: 'True'
|
|
DEBUG: 'True'
|
|
depends_on:
|
|
migrations:
|
|
condition: service_completed_successfully
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./:/home/mediacms.io/mediacms/
|
|
|
|
celery_short:
|
|
image: mediacms/mediacms-dev:7.3
|
|
restart: unless-stopped
|
|
command: ["/home/mediacms.io/bin/celery", "-A", "cms", "worker", "-Q", "short_tasks", "-c", "10", "--soft-time-limit=300", "--loglevel=INFO", "-n", "short@%h"]
|
|
environment:
|
|
DEVELOPMENT_MODE: 'True'
|
|
DEBUG: 'True'
|
|
depends_on:
|
|
migrations:
|
|
condition: service_completed_successfully
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./:/home/mediacms.io/mediacms/
|
|
|
|
celery_long:
|
|
image: mediacms/mediacms-dev:7.3
|
|
restart: unless-stopped
|
|
command: ["/home/mediacms.io/bin/celery", "-A", "cms", "worker", "-Q", "long_tasks", "-c", "1", "-Ofair", "--prefetch-multiplier=1", "--loglevel=INFO", "-n", "long@%h"]
|
|
environment:
|
|
DEVELOPMENT_MODE: 'True'
|
|
DEBUG: 'True'
|
|
depends_on:
|
|
migrations:
|
|
condition: service_completed_successfully
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./:/home/mediacms.io/mediacms/
|
|
|
|
db:
|
|
image: postgres:17.2-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: mediacms
|
|
POSTGRES_PASSWORD: mediacms
|
|
POSTGRES_DB: mediacms
|
|
TZ: Europe/London
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:alpine
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
volumes:
|
|
postgres_data:
|