-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (86 loc) · 2.94 KB
/
Copy pathdocker-compose.yml
File metadata and controls
93 lines (86 loc) · 2.94 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
services:
# ── PHP-FPM app ──────────────────────────────────────────────────────────────
app:
build: .
container_name: webtopup_app
restart: unless-stopped
volumes:
- .:/var/www/html
env_file: .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- internal
# ── Nginx ────────────────────────────────────────────────────────────────────
nginx:
image: nginx:1.27-alpine
container_name: webtopup_nginx
restart: unless-stopped
ports:
- "${APP_PORT:-80}:80"
volumes:
- .:/var/www/html:ro
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- app
networks:
- internal
# ── MySQL ────────────────────────────────────────────────────────────────────
db:
image: mysql:8.4
container_name: webtopup_db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:-rootsecret}"
MYSQL_DATABASE: "${DB_DATABASE:-webtopup}"
MYSQL_USER: "${DB_USERNAME:-webtopup}"
MYSQL_PASSWORD: "${DB_PASSWORD:-secret}"
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD:-rootsecret}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- internal
# ── Redis ─────────────────────────────────────────────────────────────────────
redis:
image: redis:7.4-alpine
container_name: webtopup_redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
- internal
# ── Queue worker ─────────────────────────────────────────────────────────────
queue:
build: .
container_name: webtopup_queue
restart: unless-stopped
command: ["php", "artisan", "queue:work", "--tries=3", "--timeout=90"]
volumes:
- .:/var/www/html
env_file: .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- internal
volumes:
db_data:
redis_data:
networks:
internal:
driver: bridge