-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (69 loc) · 1.52 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
72
73
74
version: "3"
services:
nginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./api:/api
- ./site.conf:/etc/nginx/conf.d/default.conf
depends_on:
- api
networks:
- backend-network
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost/api/status"]
# interval: 3s
# timeout: 1s
mysql:
image: mysql:8.1
ports:
- "3036:3306"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: "accounting-db"
MYSQL_USER: "accounting"
MYSQL_PASSWORD: "accpwd"
volumes:
- mysql:/var/lib/mysql
networks:
- backend-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "$$MYSQL_USER", "-p$$MYSQL_PASSWORD"]
interval: 3s
timeout: 1s
api:
build: ./api
volumes:
- ./api:/api
depends_on:
- mysql
networks:
- backend-network
environment:
DB_DRIVER: "mysql"
DB_NAME: "accounting-db"
DB_USER: "accounting"
DB_PWD: "accpwd"
DB_PORT: "3306"
DB_HOST: "mysql"
PHINX_DB_HOST: "mysql"
frontend:
image: node:16-alpine
working_dir: /code
volumes:
- ./front:/code
ports:
- 5173:5173
networks:
- backend-network
command: ["sh", "-c", "npm i && npm run dev -- --host=0.0.0.0"]
healthcheck:
test: ["CMD", "wget", "-S", "--spider", "http://localhost:5173/index.html"]
interval: 3s
timeout: 1s
networks:
backend-network:
driver: bridge
volumes:
mysql: