-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
65 lines (60 loc) · 1.25 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
version: "3"
services:
users-svc:
build:
context: "."
networks:
- "users-svc"
ports:
- "50051:50051"
depends_on:
- "db"
- "cache"
environment:
NODE_ENV: "test"
GRPC_HOST: "0.0.0.0"
GRPC_PORT: "50051"
DB_HOST: "db"
DB_PORT: "5432"
DB_USERNAME: "postgres"
DB_PASSWORD: "postgres"
DB_DATABASE: "postgres"
DB_SCHEMA: "public"
DB_SYNC: true
REDIS_HOST: "cache"
REDIS_PORT: "6379"
healthcheck:
test: ["CMD", "/bin/grpc_health_probe", "-addr=:50051"]
interval: 30s
timeout: 10s
retries: 5
restart: "on-failure"
db:
image: "postgres:12-alpine"
networks:
- "users-svc"
expose:
- "5432"
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U postgres'"]
interval: 30s
timeout: 30s
retries: 3
restart: "on-failure"
cache:
image: "redis:5-alpine"
networks:
- "users-svc"
expose:
- "6379"
healthcheck:
test: ["CMD-SHELL", "sh -c 'redis-cli PING'"]
interval: 30s
timeout: 30s
retries: 3
restart: "on-failure"
networks:
users-svc: