-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
41 lines (38 loc) · 845 Bytes
/
Copy pathcompose.yml
File metadata and controls
41 lines (38 loc) · 845 Bytes
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
version: "3"
services:
api:
container_name: golang_tutorial_api
build:
context: .
args:
- WITH_GOTEST=1
ports:
- 8000:8000
volumes:
- .:/usr/src/app
command: go run ./cmd/server/main.go
env_file:
- .env
depends_on:
db:
condition: service_healthy
db:
image: mysql:8.0.32
container_name: golang_tutorial_db
ports:
- 3306:3306
volumes:
- mysql-volumes:/var/lib/mysql
- ./mysql/entrypoint/:/docker-entrypoint-initdb.d
- ./my.cnf:/etc/mysql/conf.d/my.cnf
environment:
MYSQL_USER: "user"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "db4test"
healthcheck:
test: ["CMD", "mysqladmin", "ping"]
interval: 10s
retries: 10
volumes:
mysql-volumes: