-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (68 loc) · 2.03 KB
/
docker-compose.yml
File metadata and controls
79 lines (68 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
version: '3.9'
services:
backend:
build:
context: .
dockerfile: Dockerfile.slim
target: production
ports:
- "8080:8080"
env_file:
- .env
environment:
# Server configuration (override .env if needed)
- PORT=8080
- HOST=0.0.0.0
- WORKERS=1
# Performance optimizations
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
# Application settings (will be overridden by .env if present)
- LOG_LEVEL=info
- MAX_UPLOAD_SIZE=50MB
- CORS_ORIGINS=*
# Note: Google OAuth, JWT, and OpenAI configurations are loaded from .env file
# Do not override them here to allow .env values to take precedence
volumes:
# Mount source code for development
- ./backend:/app/backend:delegated
- ./frontend:/app/frontend:delegated
- ./data:/app/data:cached
# Mount environment file if it exists
- ./.env:/app/.env:ro
# Development overrides
user: root
command: >
sh -c "
export PYTHONPATH=/app &&
export HOST=0.0.0.0 &&
export PORT=8080 &&
echo 'Environment variables:' &&
echo 'HOST=' && echo $HOST &&
echo 'PORT=' && echo $PORT &&
echo 'PYTHONPATH=' && echo $PYTHONPATH &&
echo 'Starting uvicorn directly...' &&
uvicorn backend.api.main:app --host 0.0.0.0 --port 8080 --reload --log-level info
"
# Resource limits for better container management
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
# Health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Restart policy
restart: unless-stopped
# Networks for better isolation
networks:
default:
name: re-archaeology-network
# Volumes for data persistence (Redis removed as not needed)
volumes:
# Redis volume removed - not using Redis in Cloud Run deployment