103 lines
2.2 KiB
YAML
103 lines
2.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Mineru API Service
|
|
mineru-api:
|
|
build:
|
|
context: ./mineru
|
|
dockerfile: Dockerfile
|
|
platform: linux/arm64
|
|
ports:
|
|
- "8001:8000"
|
|
volumes:
|
|
- ./mineru/storage/uploads:/app/storage/uploads
|
|
- ./mineru/storage/processed:/app/storage/processed
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- MINERU_MODEL_SOURCE=local
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
networks:
|
|
- app-network
|
|
|
|
# Backend API Service
|
|
backend-api:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./backend/storage:/app/storage
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
- MINERU_API_URL=http://mineru-api:8000
|
|
depends_on:
|
|
- redis
|
|
- mineru-api
|
|
networks:
|
|
- app-network
|
|
|
|
# Celery Worker
|
|
celery-worker:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
command: celery -A app.services.file_service worker --loglevel=info
|
|
volumes:
|
|
- ./backend/storage:/app/storage
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
- MINERU_API_URL=http://mineru-api:8000
|
|
depends_on:
|
|
- redis
|
|
- backend-api
|
|
networks:
|
|
- app-network
|
|
|
|
# Redis Service
|
|
redis:
|
|
image: redis:alpine
|
|
ports:
|
|
- "6379:6379"
|
|
networks:
|
|
- app-network
|
|
|
|
# Frontend Service
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- REACT_APP_API_BASE_URL=http://localhost:8000/api/v1
|
|
ports:
|
|
- "3000:80"
|
|
env_file:
|
|
- ./frontend/.env
|
|
environment:
|
|
- NODE_ENV=production
|
|
- REACT_APP_API_BASE_URL=http://localhost:8000/api/v1
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend-api
|
|
networks:
|
|
- app-network
|
|
|
|
networks:
|
|
app-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
uploads:
|
|
processed: |