-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
66 lines (66 loc) · 1.47 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
version: "3.8"
services:
gateway:
build:
context: .
dockerfile: ./cmd/gateway/Dockerfile
ports:
- 50001:50001
environment:
ADDR: 50001
DOGFOOD_BACKEND_ADDR: http://backend:50101
REDIS_HOST: redis # match service name of redis.
REDIS_ADDR: 6379
REDIS_PASSWORD: redis
RATELIMIT_TIME_UNIT: minute
RATELIMIT_LIMIT: 10
networks:
- default
depends_on:
- redis
backend:
build:
context: .
dockerfile: ./cmd/backend/Dockerfile
ports:
- 50100:50100
- 50101:50101
- 9092:9092 # metrics
environment:
POSTGRES_HOST: postgres # match service name of postgres.
POSTGRES_PORT: 5432
POSTGRES_USER: dogfood
POSTGRES_PASSWORD: dogfood
POSTGRES_DB: dogfood
GRPC_ADDR: 50100
GRPC_GATEWAY_ADDR: 50101
DD_SERVICE: dogfood
networks:
- default
depends_on:
- postgres
redis:
image: redis
ports:
- 6379:6379
environment:
REDIS_PASSWORD: redis
command: [
"bash", "-c",
'
docker-entrypoint.sh
--requirepass "$$(echo $$REDIS_PASSWORD)"
'
]
postgres:
image: postgres
ports:
- 5432:5432
restart: always
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: dogfood
POSTGRES_PASSWORD: dogfood
POSTGRES_DB: dogfood
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql