-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
54 lines (49 loc) · 1.11 KB
/
docker-compose.yaml
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
version: "3.8"
services:
api-server:
container_name: api-server
image: golang:1.17.7
working_dir: /go/src/app
ports:
- 8000:8000
command: >
bash -c "
echo ${DOCKER_NETRC} > ~/.netrc
go install github.com/cespare/reflex@latest
reflex -R '_test\.go$$' -r '(\.go$$|go\.mod|\.html$$)' -s -- sh -c 'go run ./cmd/api_server/main.go'
"
depends_on:
- mysql
volumes:
- ./go:/go/src/app
env_file:
- ./go/.env
networks:
- coffee_app_default
mysql:
container_name: mysql
image: mysql:5.7
command: mysqld --sql_mode=""
ports:
- 3306:3306
volumes:
- ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d:ro
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: coffee_app
MYSQL_ROOT_PASSWORD: password
networks:
- coffee_app_default
redis:
container_name: redis
image: redis:6.2
ports:
- 6379:6379
networks:
- coffee_app_default
volumes:
mysql:
networks:
coffee_app_default:
external: true