-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
190 lines (179 loc) · 4.27 KB
/
docker-compose.yml
File metadata and controls
190 lines (179 loc) · 4.27 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
services:
# PHP-FPM Application
app:
build:
context: .
dockerfile: Dockerfile
container_name: microhelium-app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- .:/var/www/html
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/custom.ini
networks:
- microhelium
depends_on:
- db
- redis
environment:
- PHP_OPCACHE_ENABLE=1
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
# Nginx Web Server
webserver:
image: nginx:alpine
container_name: microhelium-webserver
restart: unless-stopped
ports:
- "${APP_PORT:-8000}:80"
- "${APP_SSL_PORT:-8443}:443"
volumes:
- .:/var/www/html
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
- microhelium
depends_on:
- app
# MySQL Database
db:
image: mysql:8.0
container_name: microhelium-db
restart: unless-stopped
ports:
- "${DB_PORT:-3306}:3306"
environment:
MYSQL_DATABASE: ${DB_DATABASE:-microhelium}
MYSQL_USER: ${DB_USERNAME:-microhelium}
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootsecret}
volumes:
- microhelium-db:/var/lib/mysql
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
networks:
- microhelium
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: microhelium-redis
restart: unless-stopped
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- microhelium-redis:/data
networks:
- microhelium
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Queue Worker
queue:
build:
context: .
dockerfile: Dockerfile
container_name: microhelium-queue
restart: unless-stopped
working_dir: /var/www/html
command: php artisan queue:work --sleep=3 --tries=3 --max-time=3600
volumes:
- .:/var/www/html
networks:
- microhelium
depends_on:
- app
- db
- redis
# Scheduler (Cron)
scheduler:
build:
context: .
dockerfile: Dockerfile
container_name: microhelium-scheduler
restart: unless-stopped
working_dir: /var/www/html
command: /bin/sh -c "while true; do php artisan schedule:run --verbose --no-interaction; sleep 60; done"
volumes:
- .:/var/www/html
networks:
- microhelium
depends_on:
- app
- db
# Auto-Judge Worker
autojudge:
build:
context: .
dockerfile: Dockerfile.judge
container_name: microhelium-autojudge
restart: unless-stopped
working_dir: /var/www/html
command: php artisan autojudge:start --sleep=5
volumes:
- .:/var/www/html
- ./storage/app/judge:/var/www/html/storage/app/judge
- ./storage/app/problems:/var/www/html/storage/app/problems
networks:
- microhelium
depends_on:
- app
- db
privileged: true
cap_add:
- SYS_PTRACE
# Node.js for Development (Vite)
node:
image: node:20-alpine
container_name: microhelium-node
working_dir: /var/www/html
volumes:
- .:/var/www/html
ports:
- "${VITE_PORT:-5173}:5173"
networks:
- microhelium
command: sh -c "npm install && npm run dev -- --host"
profiles:
- dev
# phpMyAdmin (Optional)
phpmyadmin:
image: phpmyadmin:latest
container_name: microhelium-phpmyadmin
restart: unless-stopped
ports:
- "${PMA_PORT:-8080}:80"
environment:
PMA_HOST: db
PMA_USER: ${DB_USERNAME:-microhelium}
PMA_PASSWORD: ${DB_PASSWORD:-secret}
networks:
- microhelium
depends_on:
- db
profiles:
- tools
# Mailpit (Local mail testing)
mailpit:
image: axllent/mailpit
container_name: microhelium-mailpit
restart: unless-stopped
ports:
- "${MAIL_PORT:-1025}:1025"
- "${MAILPIT_UI_PORT:-8025}:8025"
networks:
- microhelium
profiles:
- dev
networks:
microhelium:
driver: bridge
volumes:
microhelium-db:
driver: local
microhelium-redis:
driver: local