-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-no-grpc.yaml
162 lines (158 loc) · 4.09 KB
/
docker-compose-no-grpc.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: "3.9"
services:
web:
build:
context: .
dockerfile: ./src/web-service/Dockerfile
environment:
PORT: 8080
TZ: Europe/Berlin
networks:
- backend
proxy:
ports:
- "8080:8080"
build:
context: .
dockerfile: ./src/reverse-proxy/Dockerfile
environment:
PORT: 8080
CONFIG_FILE_PATH: /config.yaml
TZ: Europe/Berlin
volumes:
- ./src/reverse-proxy/config.yaml:/config.yaml
networks:
- backend
user:
build:
context: .
dockerfile: ./src/user-service/Dockerfile
environment:
AUTH_IS_ACTIVE: $AUTH_IS_ACTIVE
GRPC_COMMUNICATION: false
PORT: 8080
GRPC_PORT: 8081
JWT_ACCESS_PRIVATE_KEY_PATH: /certs/access-key.pem
JWT_ACCESS_PUBLIC_KEY_PATH: /certs/access-public.pem
JWT_REFRESH_PRIVATE_KEY_PATH: /certs/refresh-key.pem
JWT_REFRESH_PUBLIC_KEY_PATH: /certs/refresh-public.pem
JWT_ACCESS_TOKEN_EXPIRATION: $JWT_ACCESS_TOKEN_EXPIRATION
JWT_REFRESH_TOKEN_EXPIRATION: $JWT_REFRESH_TOKEN_EXPIRATION
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
TZ: Europe/Berlin
volumes:
- type: bind
source: ./src/user-service/certs
target: /certs
read_only: true
networks:
- backend
depends_on:
db:
condition: service_healthy
test-data:
condition: service_healthy
book:
build:
context: .
dockerfile: ./src/book-service/Dockerfile
environment:
AUTH_IS_ACTIVE: $AUTH_IS_ACTIVE
GRPC_COMMUNICATION: false
AUTH_SERVICE_ENDPOINT: http://user:8080/validate-token
TRANSACTION_SERVICE_ENDPOINT: http://transaction:8080/check-chapter-bought
PORT: 8080
GRPC_PORT: 8081
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
TZ: Europe/Berlin
networks:
- backend
depends_on:
db:
condition: service_healthy
test-data:
condition: service_healthy
transaction:
build:
context: .
dockerfile: ./src/transaction-service/Dockerfile
environment:
AUTH_IS_ACTIVE: $AUTH_IS_ACTIVE
GRPC_COMMUNICATION: false
AUTH_SERVICE_ENDPOINT: http://user:8080/validate-token
BOOK_SERVICE_ENDPOINT: http://book:8080/valdiate-chapter-id
USER_SERVICE_ENDPOINT: http://user:8080/move-user-amount
PORT: 8080
GRPC_PORT: 8081
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
TZ: Europe/Berlin
networks:
- backend
depends_on:
db:
condition: service_healthy
test-data:
condition: service_healthy
test-data:
build:
context: .
dockerfile: ./src/test-data-service/Dockerfile
environment:
RESET_ON_INIT: true
TEST_DATA_USER_PASSWORD: $TEST_DATA_USER_PASSWORD
TEST_DATA_FILE_PATH: /init.sql
PORT: 8080
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
TZ: Europe/Berlin
volumes:
- type: bind
source: ./src/test-data-service/init.sql
target: /init.sql
read_only: true
networks:
- backend
healthcheck:
test: curl -q --fail http://localhost:8080/health
interval: 5s
timeout: 5s
start_period: 5s
retries: 5
depends_on:
db:
condition: service_healthy
db:
image: postgres:latest
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
TZ: Europe/Berlin
networks:
- backend
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
backend:
driver: bridge
name: backend