-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
79 lines (68 loc) · 1.28 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
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
version: '3.9'
x-common-env: &common-env
POSTGRES_URL: postgres://postgres@postgres:5432/postgres?sslmode=disable
REDIS_ADDR: redis:6379
x-common-build: &common-build
image: golang:latest
working_dir: /src
environment:
<<: *common-env
volumes:
- .:/src
- ~/go/pkg/mod/cache:/go/pkg/mod/cache
services:
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
redis:
image: redis:6.2-alpine
build:
<<: *common-build
command:
- make
- build
generate:
<<: *common-build
command:
- make
- generate
test:
<<: *common-build
command:
- make
- test
depends_on:
- postgres
- redis
lint:
image: golangci/golangci-lint:v1.44.0
working_dir: /src
environment:
GOLANGCI_LINT_CACHE: /src/.cache/golangci-lint-cache
volumes:
- .:/src
command:
- make
- lint
image:
image: dcard-shortener-api:latest
build:
context: .
environment:
<<: *common-env
shortener-api:
image: dcard-shortener-api:latest
environment:
<<: *common-env
command:
- /cmd
depends_on:
- postgres
- redis
restart: on-failure:5
ports:
- 8008:8008
volumes:
- .:/src
working_dir: /src