forked from kmc-jp/MinWeb2025-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (74 loc) · 2.03 KB
/
docker-compose.yml
File metadata and controls
78 lines (74 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
services:
backend:
image: rust:latest
build:
context: ./backend
volumes:
- ./backend:/usr/src/app
ports:
- "3000:3000"
environment:
- DATABASE_URL=mysql://user:password@mysql:3306/minweb
- RUST_LOG=debug
depends_on:
mysql:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
working_dir: /usr/src/app
frontend:
image: node:20-alpine
working_dir: /app
volumes:
- ./frontend:/app
- frontend_build:/var/www/html
environment:
- REACT_APP_API_URL=http://backend:3000/api/
command: sh -c "npm install && npm run build && cp -r build/* /var/www/html/"
depends_on:
- backend
networks:
- app-network
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/logs:/var/log/nginx
- frontend_build:/var/www/html
depends_on:
- backend
- frontend
restart: unless-stopped
networks:
- app-network
mysql:
image: mysql:8.0
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/todo-axum-mysql
- ./mysql/init:/docker-entrypoint-initdb.d
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_DATABASE=minweb
- MYSQL_USER=user
- MYSQL_PASSWORD=password
- TZ=Asia/Tokyo
- PGTZ=Asia/Tokyo
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "user", "--password=password"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql_data:
frontend_build:
networks:
app-network:
driver: bridge