-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (46 loc) · 1.12 KB
/
docker-compose.yml
File metadata and controls
49 lines (46 loc) · 1.12 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
services:
db:
image: postgres:16-alpine
restart: always
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: otp_service
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d otp_service"]
interval: 5s
timeout: 2s
retries: 10
redis:
image: redis:7-alpine
command: ["redis-server", "--requirepass", "redispass"]
environment:
- REDIS_PASSWORD=redispass
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "-a", "redispass", "ping"]
interval: 5s
timeout: 2s
retries: 5
app:
build: .
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
- DATABASE_DSN=host=db user=user password=password dbname=otp_service port=5432 sslmode=disable
- REDIS_ADDR=redis:6379
- REDIS_PASS=redispass
- JWT_SECRET=change_this_to_a_strong_secret
ports:
- "8080:8080"
command: ["./otp-auth-service"]
volumes:
db-data: