-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (109 loc) · 3.47 KB
/
docker-compose.yml
File metadata and controls
133 lines (109 loc) · 3.47 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: '3.8'
services:
# ==========================================
# Backend Service
# ==========================================
backend:
container_name: codeinsight-backend
build:
context: .
dockerfile: Dockerfile
target: production
restart: unless-stopped
ports:
- "3002:3002"
environment:
# Server
- NODE_ENV=production
- PORT=3002
# Database (Neon)
- DATABASE_URL=${DATABASE_URL}
# CORS
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost}
# Firebase
- FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}
- FIREBASE_CLIENT_EMAIL=${FIREBASE_CLIENT_EMAIL}
- FIREBASE_PRIVATE_KEY=${FIREBASE_PRIVATE_KEY}
- ADMIN_FIREBASE_UID=${ADMIN_FIREBASE_UID}
# Docker (C Simulator)
- DOCKER_IMAGE=${DOCKER_IMAGE:-gcc:latest}
- DOCKER_MEMORY_LIMIT=${DOCKER_MEMORY_LIMIT:-128m}
- DOCKER_CPU_LIMIT=${DOCKER_CPU_LIMIT:-0.5}
- DOCKER_PID_LIMIT=${DOCKER_PID_LIMIT:-50}
- DOCKER_TMPFS_SIZE=${DOCKER_TMPFS_SIZE:-10m}
# C Execution Timeouts
- C_RUN_DEFAULT_TIMEOUT=${C_RUN_DEFAULT_TIMEOUT:-10}
- C_RUN_MAX_TIMEOUT=${C_RUN_MAX_TIMEOUT:-30}
- C_JUDGE_TIMEOUT=${C_JUDGE_TIMEOUT:-5}
- C_EXECUTOR_BUFFER_SIZE=${C_EXECUTOR_BUFFER_SIZE:-10485760}
# Code Limits
- CODE_MAX_LENGTH=${CODE_MAX_LENGTH:-50000}
- JSON_BODY_LIMIT=${JSON_BODY_LIMIT:-1mb}
# AI APIs (Optional)
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- DEEPSEEK_BASE_URL=${DEEPSEEK_BASE_URL:-https://api.deepseek.com}
- XAI_API_KEY=${XAI_API_KEY:-}
- XAI_API_URL=${XAI_API_URL:-https://api.x.ai/v1/chat/completions}
# Ollama (Optional - host machine)
- OLLAMA_URL=${OLLAMA_URL:-http://host.docker.internal:5044}
- OLLAMA_MODEL=${OLLAMA_MODEL:-qwen2.5-coder:7b}
# Telegram (Optional)
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
# Scheduler
- DAILY_PROBLEM_CRON=${DAILY_PROBLEM_CRON:-0 9 * * *}
- TIMEZONE=${TIMEZONE:-Asia/Seoul}
volumes:
# Docker-in-Docker (for C simulator)
- /var/run/docker.sock:/var/run/docker.sock
# Persistent data
- backend-logs:/app/packages/backend/logs
- backend-tmp:/app/packages/backend/tmp
- backend-data:/app/packages/backend/data
networks:
- codeinsight-network
depends_on:
- frontend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3002/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# ==========================================
# Frontend Service (Nginx)
# ==========================================
frontend:
container_name: codeinsight-frontend
build:
context: .
dockerfile: Dockerfile.frontend
target: production
args:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3002}
restart: unless-stopped
ports:
- "80:80"
networks:
- codeinsight-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
# ==========================================
# Volumes
# ==========================================
volumes:
backend-logs:
driver: local
backend-tmp:
driver: local
backend-data:
driver: local
# ==========================================
# Networks
# ==========================================
networks:
codeinsight-network:
driver: bridge