-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
136 lines (130 loc) · 3.89 KB
/
Copy pathdocker-compose.yml
File metadata and controls
136 lines (130 loc) · 3.89 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
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
services:
valkey:
image: valkey/valkey:8.0-alpine
container_name: trainbooking-valkey
ports:
- '35652:6379'
networks:
- trainbooking-network
healthcheck:
test: ['CMD', 'valkey-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:18-alpine
container_name: trainbooking-postgres
environment:
POSTGRES_DB: trainbooking
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
TZ: UTC
PGTZ: UTC
ports:
- '5432:5432'
volumes:
- trainbooking-data:/var/lib/postgresql
networks:
- trainbooking-network
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
command:
- 'postgres'
- '-c'
- 'timezone=UTC'
backend:
build:
# Context is the project root so the Gradle build can reach
# build-logic/ and gradle/libs.versions.toml (referenced from
# backend/settings.gradle.kts via relative paths).
context: .
dockerfile: backend/Dockerfile
container_name: trainbooking-backend
env_file: .env
environment:
SPRING_PROFILES_ACTIVE: dev
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/trainbooking
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: postgres
VALKEY_HOST: valkey
VALKEY_PORT: 6379
TZ: UTC
ports:
- '43565:8080'
healthcheck:
test:
[
'CMD-SHELL',
'wget -qO- http://localhost:8080/actuator/health || exit 1',
]
interval: 15s
timeout: 5s
retries: 10
start_period: 60s
depends_on:
valkey:
condition: service_healthy
postgres:
condition: service_healthy
networks:
- trainbooking-network
customer:
build:
# Context is the project root so the codegen step in the Dockerfile
# can read shared/api-contracts/openapi.yaml (referenced by
# frontend/customer/openapi-ts.config.ts via a relative path).
context: .
dockerfile: frontend/customer/Dockerfile
args:
BACKEND_URL: http://backend:8080
container_name: trainbooking-customer
environment:
BACKEND_URL: http://backend:8080
ports:
- '41250:3000'
healthcheck:
test:
[
'CMD',
'bun',
'-e',
"const res = await fetch('http://127.0.0.1:3000/'); if
(!res.ok) throw new Error(`HTTP $${res.status}`);",
]
interval: 15s
timeout: 5s
retries: 10
start_period: 30s
depends_on:
backend:
condition: service_healthy
networks:
- trainbooking-network
caddy:
image: caddy:2-alpine
container_name: trainbooking-caddy
profiles:
- proxy
ports:
- '2015:2015'
volumes:
- ./conf/Caddyfile.dev:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
backend:
condition: service_healthy
customer:
condition: service_healthy
networks:
- trainbooking-network
networks:
trainbooking-network:
driver: bridge
volumes:
trainbooking-data:
caddy_data:
caddy_config: