-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (58 loc) · 1.73 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (58 loc) · 1.73 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
services:
# ── MySQL Database ──────────────────────────────────────────────────────────
db:
image: mysql:8.0
container_name: productapp_db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: productdb
MYSQL_USER: appuser #
MYSQL_PASSWORD: apppassword
ports:
- "3307:3306"
volumes:
- db_data:/var/lib/mysql
networks:
- app_network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "appuser", "-papppassword"]
interval: 10s
timeout: 5s
# ── Web Application ─────────────────────────────────────────────────────────
app:
build: .
container_name: productapp_web
restart: unless-stopped
ports:
- "3000:3000"
environment:
DB_HOST: db
DB_PORT: 3306
DB_USER: appuser
DB_PASSWORD: apppassword
DB_NAME: productdb
SESSION_SECRET: super_secret_change_in_production
PORT: 3000
depends_on:
db:
condition: service_healthy
networks:
- app_network
# Adminer is a lightweight web-based MySQL client for managing the database.Visit http://localhost:8080 to view DB
adminer:
image: adminer:latest
container_name: productapp_adminer
restart: unless-stopped
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
networks:
- app_network
volumes:
db_data:
networks:
app_network:
driver: bridge