-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
74 lines (68 loc) · 1.45 KB
/
docker-compose.yaml
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
version: "3.9"
services:
# FE service
frontend:
image: frontend:v1
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "5173:5173"
environment:
- NODE_ENV=development
- VITE_TARGET=http://backend:3000/
networks:
- app-network
# BE service
backend:
image: backend:v1
build:
context: ./backend-api
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=root
- DB_PASS=1
- DB_NAME=pizza
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- mysql # wait MySQL ready first
- redis # wait Redis ready first
networks:
- app-network
# MySQL database service
mysql:
image: mysql:8.0
container_name: mysql
command: mysqld --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1
MYSQL_DATABASE: pizza
ports:
- "3308:3306"
volumes:
- db_data:/var/lib/mysql
- ./backend-api/src/database/pizza.sql:/docker-entrypoint-initdb.d/pizza.sql:ro
networks:
- app-network
# Redis service
redis:
image: redis:7.0
container_name: redis
restart: always
ports:
- "6380:6379"
networks:
- app-network
volumes:
db_data:
# store the data of this MySQL service
networks:
app-network:
driver: bridge