-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
107 lines (101 loc) · 2.35 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
102
103
104
105
106
107
version: "3"
services:
users-svc:
image: "users-svc:dev"
container_name: "users-svc"
build:
context: "./microservices/users-svc"
networks:
- "frontend"
- "backend"
- "usersdomain"
expose:
- "50051"
depends_on:
- "users-db"
- "cache"
environment:
NODE_ENV: "__tests__"
GRPC_HOST: "0.0.0.0"
GRPC_PORT: "50051"
DB_HOST: "users-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"
api-gateway:
image: "api-gateway:dev"
container_name: "api-gateway"
build:
context: "./api-gateway"
networks:
- "frontend"
ports:
- "3000:3000"
depends_on:
- "cache"
- "users-svc"
environment:
NODE_ENV: "__tests__"
GRAPHQL_PORT: "3000"
JWT_ACCESSTOKEN_SECRET: "VtWeuJo5cPrH1gzvLX0HwPkcbVVeMkV0/a2JFeP3hGE="
JWT_REFRESHTOKEN_SECRET: "tPQz6vb7nJDilma85OQExilvgZX+QyEf1CL95DmfBLA="
JWT_ISSUER: "application"
JWT_AUDIENCE: "public"
USERS_SVC_URL: "users-svc:50051"
REDIS_HOST: "cache"
REDIS_PORT: "6379"
healthcheck:
test: ["CMD", "wget", "localhost:3000/healthz -q -O - > /dev/null 2>&1"]
interval: 30s
timeout: 10s
retries: 5
restart: "on-failure"
users-db:
image: "postgres:12-alpine"
container_name: "users-db"
networks:
- "usersdomain"
expose:
- "5432"
volumes:
- usersdata:/var/lib/postgresql/data
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"
container_name: "redis-cache"
networks:
- "frontend"
- "backend"
expose:
- "6379"
healthcheck:
test: ["CMD-SHELL", "sh -c 'redis-cli PING'"]
interval: 30s
timeout: 30s
retries: 3
restart: "on-failure"
networks:
frontend:
backend:
usersdomain:
volumes:
usersdata: