-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
71 lines (66 loc) · 1.58 KB
/
docker-compose.yml
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
version: '3.9'
services:
mysql:
image: mysql:latest
container_name: mysql
restart: always
ports:
- "3306:3306"
networks:
- bridge
volumes:
- mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=onepte
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s # Wait 20 seconds between checks
timeout: 10s # Consider the check failed if it takes longer than 10 seconds
retries: 10 # After 10 failed attempts, consider the container unhealthy
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
restart: always
ports:
- "8081:80"
networks:
- bridge
environment:
- PMA_HOST=mysql
- MYSQL_ROOT_PASSWORD=root
depends_on:
- mysql
app:
build:
context: ./
dockerfile: Dockerfile
container_name: node-app
restart: always
ports:
- "3001:3001"
networks:
- bridge
environment:
- SERVER_PORT=3001
- ALLOWED_ORIGINS=http://localhost:3000
- NODE_ENV=production
- API_PREFIX=/api/v1
- APPLICATION_NAME=OnePTE
- DB_HOST=mysql
- DB_PORT=3306
- DB_LOGIN_NAME=root
- DB_LOGIN_PASSWORD=root
- DB_NAME=onepte
- JWT_ACCESS_SECRET=myaccesssecret
- JWT_ACCESS_EXPIRES_IN=5m
- JWT_REFRESH_SECRET=myrefreshsecret
- JWT_REFRESH_EXPIRES_IN=7d
depends_on:
mysql:
condition: service_healthy
networks:
bridge:
driver: bridge
volumes:
mysql-data: