generated from AInine9/golang-react-mysql-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
48 lines (45 loc) · 931 Bytes
/
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
# docker-compose.yml
version: "3.9"
services:
frontend:
build:
context: .
dockerfile: "./Dockerfile-react"
volumes:
- ./frontend:/frontend
command: >
sh -c "npm install && npm run start"
ports:
- "3000:3000"
backend:
build:
context: .
dockerfile: ./Dockerfile-golang
ports:
- 8000:8000
volumes:
- ./backend:/app
env_file:
- variables.env
depends_on:
- db
restart: on-failure
db:
image: mysql:8.0
volumes:
- './db/data:/var/lib/mysql'
- './db/my.cnf:/etc/mysql/conf.d/my.cnf'
- "./ddl:/docker-entrypoint-initdb.d"
env_file:
- variables.env
ports:
- '3306:3306'
restart: on-failure
swagger-ui:
image: swaggerapi/swagger-ui
ports:
- "8081:8080"
volumes:
- ./openapi.yml:/data/openapi.yml
environment:
SWAGGER_JSON: /data/openapi.yml