-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
41 lines (41 loc) · 936 Bytes
/
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
services:
api:
image: url-short:latest
env_file:
- .env
ports:
- 5001:8080
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost/api/v1/healthz || exit 1
interval: 2s
retries: 5
timeout: 10s
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
restart: always
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
user: postgres
volumes:
- pgdata:/var/lib/postgresql/data
- ./bin/local-init.sql:/docker-entrypoint-initdb.d/local-init.sql
ports:
- 5002:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 10
redis:
image: 'bitnami/redis:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 5003:6379
volumes:
pgdata: