-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
55 lines (55 loc) · 1.19 KB
/
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
# for local testing of the entire stack
services:
web:
build: ./web
container_name: 3tier-web
environment:
- API_HOST=http://api:${API_PORT}
- PORT=${WEB_PORT}
ports:
- 3001:${WEB_PORT}
healthcheck:
test: "wget --no-verbose --spider localhost:${WEB_PORT}/"
interval: 30s
timeout: 5s
start_period: 5s
retries: 3
depends_on:
- api
api:
build: ./api
container_name: 3tier-api
environment:
- DB_PASS=${DB_PASS}
- DB_HOST=db
- PORT=${API_PORT}
ports:
- 8081:8080
healthcheck:
test: "wget --no-verbose --spider localhost:${API_PORT}/api/status"
interval: 5s
timeout: 5s
start_period: 5s
retries: 3
depends_on:
db:
condition: service_healthy
restart: true
db:
image: postgres:15-alpine
container_name: 3tier-db
environment:
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_USER=app
- POSTGRES_DB=3tier
- PGDATA=/data/pgdata
volumes:
- pgdata:/data
healthcheck:
test: "pg_isready -h localhost"
interval: 30s
timeout: 5s
start_period: 5s
retries: 3
volumes:
pgdata: