-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompose.yaml
More file actions
71 lines (68 loc) · 1.8 KB
/
Copy pathcompose.yaml
File metadata and controls
71 lines (68 loc) · 1.8 KB
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
services:
# The Cookie Factory backend in SpringBoot
tcf-server:
image: pcollet/tcf-spring-backend
container_name: backend
ports:
- "8080:8080"
environment:
- BANK_WITH_PORT=bank-system:9090
- POSTGRES_HOST=postgres:5432
restart: always
depends_on:
bank-system:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: "curl --silent --fail localhost:8080/actuator/health | grep UP || exit 1"
interval: 5s
timeout: 3s
retries: 3
start_period: 10s
# the postgres DB to be connected to the backend (watch out: no volume specified, everything can be lost)
postgres:
image: postgres:18.1
container_name: db
environment:
- POSTGRES_PASSWORD=postgrespass
- POSTGRES_USER=postgresuser
- POSTGRES_DB=tcf-db
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d tcf-db -U $$POSTGRES_USER" ]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
# A simple java CLI
tcf-cli:
image: pcollet/tcf-spring-cli
container_name: cli
environment:
- SERVER_WITH_PORT=tcf-server:8080
depends_on:
tcf-server:
condition: service_healthy
volumes:
- ./cli/demo.txt:/opt/app/demo.txt
stdin_open: true
tty: true
healthcheck:
test: "curl --silent --fail localhost:8081/actuator/health | grep UP || exit 1"
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
# An external bank service in NestJs
bank-system:
image: pcollet/tcf-bank-service
container_name: bank
ports:
- "9090:9090"
healthcheck:
test: [ "CMD", "/nodejs/bin/node" , "healthcheck.js" ]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s