changes to mobile styling in modal view, complete reword of backend worker system
This commit is contained in:
+97
-4
@@ -1,10 +1,103 @@
|
||||
services:
|
||||
# Redis message broker for Celery
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
# PostgreSQL database (production-ready)
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER:-imagerepo}
|
||||
POSTGRES_PASSWORD: ${DB_PASS:-postgres}
|
||||
POSTGRES_DB: ${DB_NAME:-imagerepo}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-imagerepo}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
# Flask web application
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
- DB_TYPE=postgresql
|
||||
- DB_USER=${DB_USER:-imagerepo}
|
||||
- DB_PASS=${DB_PASS:-postgres}
|
||||
- DB_HOST=postgres
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=${DB_NAME:-imagerepo}
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||
volumes:
|
||||
- ./imagerepo/db/:/db # SQLite db storage
|
||||
- ./imagerepo/images:/images # where the app will store it's imported images
|
||||
- ./import:/import # where it will import images from
|
||||
- ./migrations:/app/migrations # for dev
|
||||
- ./imagerepo/db/:/db # Legacy SQLite path (not used with PostgreSQL)
|
||||
- ./imagerepo/images:/images
|
||||
- ./import:/import
|
||||
- ./migrations:/app/migrations # For dev
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
# Celery worker for processing import tasks
|
||||
celery-worker:
|
||||
build: .
|
||||
command: celery -A app.celery_app:celery worker --loglevel=info -Q scan,import,thumbnail,sidecar,default --concurrency=${CELERY_WORKER_CONCURRENCY:-2}
|
||||
environment:
|
||||
- DB_TYPE=postgresql
|
||||
- DB_USER=${DB_USER:-imagerepo}
|
||||
- DB_PASS=${DB_PASS:-postgres}
|
||||
- DB_HOST=postgres
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=${DB_NAME:-imagerepo}
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||
- CELERY_WORKER_CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-2}
|
||||
volumes:
|
||||
- ./imagerepo/images:/images
|
||||
- ./import:/import
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
# Celery Beat scheduler for periodic tasks
|
||||
celery-beat:
|
||||
build: .
|
||||
command: celery -A app.celery_app:celery beat --loglevel=info
|
||||
environment:
|
||||
- DB_TYPE=postgresql
|
||||
- DB_USER=${DB_USER:-imagerepo}
|
||||
- DB_PASS=${DB_PASS:-postgres}
|
||||
- DB_HOST=postgres
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=${DB_NAME:-imagerepo}
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||
- IMPORT_EVERY_SECONDS=${IMPORT_EVERY_SECONDS:-28800}
|
||||
depends_on:
|
||||
- redis
|
||||
- celery-worker
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user