generated from dmm-com/mission-dmm-bootcamp-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
49 lines (47 loc) · 1.16 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
version: '3.7'
services:
mysql:
image: mysql:5.7
command: "mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --default-time-zone='+9:00'"
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: yatter
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_USER: yatter
MYSQL_PASSWORD: yatter
volumes:
- "./.data/mysql:/var/lib/mysql"
- "./ddl:/docker-entrypoint-initdb.d"
restart: on-failure
web:
build:
context: .
dockerfile: Dockerfile
target: dev
working_dir: "/work/yatter-backend-go"
command: ["air"]
volumes:
- ".:/work/yatter-backend-go"
- "./.data/go-pkg:/go/pkg/mod/cache"
ports:
- "8080:8080"
env_file:
- docker-compose-default.env
depends_on:
- mysql
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/v1/health"]
interval: 1m
timeout: 10s
retries: 3
start_period: 30s
restart: on-failure
swagger-ui:
image: swaggerapi/swagger-ui
ports:
- "8081:8080"
volumes:
- ./openapi.yml:/data/openapi.yml
environment:
SWAGGER_JSON: /data/openapi.yml