-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
87 lines (87 loc) · 1.89 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
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3.9'
services:
db:
image: mysql:8.3.0
container_name: product_db
platform: linux/x86_64
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=product_db
- MYSQL_ROOT_PASSWORD=product_db_management
volumes:
- db_data:/var/lib/mysql
restart: 'always'
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 10s
retries: 5
cap_add:
- SYS_NICE
networks:
- network
backend:
container_name: app_backend
build:
context: ./app/backend
dockerfile: Dockerfile
args:
APP_PORT: ${APP_PORT}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
ports:
- "3001:3001"
platform: linux/x86_64
working_dir: /app-backend
volumes:
- ./backend/src:/app-backend/src
depends_on:
db:
condition: service_healthy
environment:
- APP_PORT=3001
- DB_USER=spring_user
- DB_PASS=product_db_management
- DB_HOST=db
- DB_PORT=3306
- DB_URL=jdbc:mysql://db:3306/product_db
healthcheck:
test: ["CMD", "lsof", "-t", "-i:3001"]
timeout: 10s
retries: 5
networks:
- network
frontend:
container_name: app_frontend
build:
context: ./app/frontend
target: dev
restart: 'always'
command: npm run dev
environment:
- NODE_ENV=development
- WATCHPACK_POLLING=true
volumes:
- .:/frontend
- /frontend/node_modules
- /frontend/.next
ports:
- "3000:3000"
platform: linux/x86_64
working_dir: /app-frontend
depends_on:
backend:
condition: service_healthy
healthcheck:
test: [ "CMD", "lsof", "-t", "-i:3000" ]
timeout: 10s
retries: 5
networks:
- network
networks:
network:
driver: bridge
volumes:
db_data: