mirror of
https://github.com/kjanat/livegraphs-django.git
synced 2026-02-13 14:15:42 +01:00
Introduces uv-based Docker workflow with non-root runtime, cached installs, and uv-run for web and Celery. Updates docker-compose to Postgres + Redis, loads .env, and removes source bind mount for reproducible builds. Switches settings to use Postgres when env is present with SQLite fallback; broadens allowed hosts for containerized development. Adds psycopg2-binary and updates sample env for Redis in Docker. Adds company scoping to external data models and links sessions during ingestion; provides management commands to seed a Jumbo company/users and sync external chat data into the dashboard. Includes .dockerignore, TypeScript config and typings, and minor template/docs tweaks. Requires database migration.
102 lines
2.5 KiB
YAML
102 lines
2.5 KiB
YAML
# docker-compose.yml
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
command: uv run gunicorn dashboard_project.wsgi:application --bind 0.0.0.0:8000 --chdir dashboard_project
|
|
volumes:
|
|
- static_volume:/app/staticfiles
|
|
- media_volume:/app/media
|
|
ports:
|
|
- 8000:8000
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/dashboard_db
|
|
- POSTGRES_DB=dashboard_db
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_HOST=db
|
|
- POSTGRES_PORT=5432
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
|
|
db:
|
|
image: postgres:alpine
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=dashboard_db
|
|
ports:
|
|
- 5432:5432
|
|
|
|
redis:
|
|
image: redis:alpine
|
|
ports:
|
|
- 6379:6379
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: [CMD, redis-cli, ping]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
celery:
|
|
build: .
|
|
command: uv run celery -A dashboard_project worker --loglevel=info --workdir dashboard_project
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/dashboard_db
|
|
- POSTGRES_DB=dashboard_db
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_HOST=db
|
|
- POSTGRES_PORT=5432
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
depends_on:
|
|
- redis
|
|
- web
|
|
|
|
celery-beat:
|
|
build: .
|
|
command: uv run celery -A dashboard_project beat --scheduler django_celery_beat.schedulers:DatabaseScheduler --workdir dashboard_project
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/dashboard_db
|
|
- POSTGRES_DB=dashboard_db
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_HOST=db
|
|
- POSTGRES_PORT=5432
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
depends_on:
|
|
- redis
|
|
- web
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- ./nginx/conf.d:/etc/nginx/conf.d
|
|
- static_volume:/app/staticfiles
|
|
- media_volume:/app/media
|
|
depends_on:
|
|
- web
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
static_volume:
|
|
media_volume:
|