-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
101 lines (89 loc) · 1.68 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '3.9'
x-common-env: &common-env
GOPATH: /go
GOCACHE: /src/.cache/gocache
MONGO_URL: mongodb://mongo:27017/
MONGO_DATABASE: blog_server
REDIS_ADDR: redis:6379
JWT_SECRETKEY: D*G-KaPdSgVkYp3s6v9y$B&E)H+MbQeT
x-common-build: &common-build
image: justin0u0/golang-protoc:protoc-3.19.3-golang-1.17
working_dir: /src
environment:
<<: *common-env
volumes:
- .:/src
- ~/go/pkg/mod/cache:/go/pkg/mod/cache
services:
mongo:
image: mongo:5
redis:
image: redis:6.2-alpine
generate:
<<: *common-build
command:
- make
- generate
lint:
image: golangci/golangci-lint:v1.44.2
working_dir: /src
environment:
GOLANGCI_LINT_CACHE: /src/.cache/golangci-lint-cache
volumes:
- .:/src
command:
- make
- lint
build:
<<: *common-build
command:
- make
- build
image:
image: tsw303005/blog-server:latest
build:
context: .
environment:
<<: *common-env
api:
image: tsw303005/blog-server:latest
environment:
<<: *common-env
command:
- /cmd
- api
- api
depends_on:
- mongo
gateway:
image: tsw303005/blog-server:latest
environment:
GRPC_SERVER_ADDR: api:8081
<<: *common-env
command:
- /cmd
- api
- gateway
depends_on:
- mongo
- api
ports:
- 8001:8080
file:
image: tsw303005/blog-server:latest
environment:
<<: *common-env
command:
- /cmd
- file
ports:
- 8082:8080
# nginx:
# image: nginx:stable
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf
# ports:
# - 8008:8008
# depends_on:
# - file
# - gateway