Files
bttoxin-pipeline/docker-compose.yml
zly c75c85c53b Refactor: Unified pipeline execution, simplified UI, and fixed Docker config
- Backend: Refactored tasks.py to directly invoke run_single_fna_pipeline.py for consistency.
- Backend: Changed output format to ZIP and added auto-cleanup of intermediate files.
- Backend: Fixed language parameter passing in API and tasks.
- Frontend: Removed CRISPR Fusion UI elements from Submit and Monitor views.
- Frontend: Implemented simulated progress bar for better UX.
- Frontend: Restored One-click load button and added result file structure documentation.
- Docker: Fixed critical Restarting loop by removing incorrect image directive in docker-compose.yml.
- Docker: Optimized Dockerfile to correct .pixi environment path issues and prevent accidental deletion of frontend assets.
2026-01-20 20:25:25 +08:00

114 lines
3.5 KiB
YAML

# Docker Compose configuration for BtToxin Pipeline
# This is the unified production configuration.
# Key features:
# 1. Uses Traefik for routing (no exposed ports on host)
# 2. Mounts existing data volumes from the original 'docker' project
# 3. Fixes PYTHONPATH issues for Celery workers
services:
postgres:
image: docker.m.daocloud.io/library/postgres:15-alpine
container_name: bttoxin-postgres
restart: unless-stopped
environment:
# Unified credentials matching the original 'docker' project
- POSTGRES_USER=bttoxin
- POSTGRES_PASSWORD=bttoxin_password
- POSTGRES_DB=bttoxin_db
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- frontend
redis:
image: docker.m.daocloud.io/library/redis:7-alpine
container_name: bttoxin-redis
restart: unless-stopped
volumes:
- redis_data:/data
networks:
- frontend
bttoxin:
build:
context: .
dockerfile: docker/dockerfiles/Dockerfile.traefik
container_name: bttoxin-pipeline
# No ports section - Traefik will handle routing via the container network
volumes:
- ./jobs:/app/jobs
environment:
- PYTHONPATH=/app:/app/backend
- JOBS_DIR=/app/jobs
- UPLOAD_DIR=/app/jobs/uploads
- RESULTS_DIR=/app/jobs/results
- DATABASE_URL=postgresql://bttoxin:bttoxin_password@bttoxin-postgres:5432/bttoxin_db
- REDIS_URL=redis://bttoxin-redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
restart: unless-stopped
depends_on:
- postgres
- redis
networks:
- frontend
labels:
# Enable Traefik for this container
- "traefik.enable=true"
- "traefik.docker.network=frontend"
# HTTP Router (redirect to HTTPS)
- "traefik.http.routers.bttoxin.rule=Host(`bttiaw.hzau.edu.cn`)"
- "traefik.http.routers.bttoxin.entrypoints=web"
- "traefik.http.routers.bttoxin.middlewares=redirect-to-https"
# HTTPS Router
- "traefik.http.routers.bttoxin-secure.rule=Host(`bttiaw.hzau.edu.cn`)"
- "traefik.http.routers.bttoxin-secure.entrypoints=websecure"
- "traefik.http.routers.bttoxin-secure.tls=true"
- "traefik.http.routers.bttoxin-secure.tls.certresolver=myresolver"
# Service configuration
- "traefik.http.services.bttoxin.loadbalancer.server.port=8000"
# TLS redirect middleware
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
worker:
build:
context: .
dockerfile: docker/dockerfiles/Dockerfile.traefik
container_name: bttoxin-worker
volumes:
- ./jobs:/app/jobs
environment:
- PYTHONPATH=/app:/app/backend
- JOBS_DIR=/app/jobs
- UPLOAD_DIR=/app/jobs/uploads
- RESULTS_DIR=/app/jobs/results
- DATABASE_URL=postgresql://bttoxin:bttoxin_password@bttoxin-postgres:5432/bttoxin_db
- REDIS_URL=redis://bttoxin-redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
restart: unless-stopped
depends_on:
- postgres
- redis
networks:
- frontend
command: celery -A backend.app.core.celery_app worker --loglevel=info
networks:
frontend:
external: true
volumes:
# Mount the existing volumes from the 'docker' project
postgres_data:
external: false
name: bttoxin_postgres_data_v2
redis_data:
external: true
name: docker_redis_data