HH/docker-compose.yml

151 lines
3.7 KiB
YAML

version: '3.8'
services:
db:
image: postgres:15-alpine
container_name: px360_db
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=px360
- POSTGRES_USER=px360
- POSTGRES_PASSWORD=px360
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U px360"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: px360_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_web
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- DJANGO_SETTINGS_MODULE=config.settings.dev
- SENTRY_DSN=http://52653adf0f0b4618bfab78806637fe7d@bugsink:8000/1
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput || true &&
gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 --reload"
volumes:
- .:/app
- media_volume:/app/media
ports:
- "8000:8000"
env_file:
- .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
celery:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_celery
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- DJANGO_SETTINGS_MODULE=config.settings.dev
- SENTRY_DSN=http://52653adf0f0b4618bfab78806637fe7d@bugsink:8000/1
command: celery -A config worker -l info --autoreload
volumes:
- .:/app
env_file:
- .env
depends_on:
- db
- redis
- web
celery-beat:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_celery_beat
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- DJANGO_SETTINGS_MODULE=config.settings.dev
- SENTRY_DSN=http://52653adf0f0b4618bfab78806637fe7d@bugsink:8000/1
command: celery -A config beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
volumes:
- .:/app
env_file:
- .env
depends_on:
- db
- redis
- web
bugsink:
image: bugsink/bugsink:latest
container_name: px360_bugsink
ports:
- "9000:8000"
volumes:
- bugsink_data:/data
environment:
- SECRET_KEY=bugsink-prod-secret-key-3f8a2c5e9b1d4f7a6c0e2d5b8f1a4c7e
restart: unless-stopped
openobserve:
image: openobserve/openobserve:latest
container_name: px360_openobserve
ports:
- "5080:5080"
volumes:
- openobserve_data:/data
environment:
- ZO_ROOT_USER_EMAIL=root@example.com
- ZO_ROOT_USER_PASSWORD=Complexpass#123
- ZO_DATA_DIR=/data
restart: unless-stopped
vector:
image: timberio/vector:latest-debian
container_name: px360_vector
command: ["--config", "/etc/vector/vector.toml"]
volumes:
- ./vector.toml:/etc/vector/vector.toml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- openobserve
restart: unless-stopped
volumes:
postgres_data:
media_volume:
bugsink_data:
openobserve_data: