-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (43 loc) · 1.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
46 lines (43 loc) · 1.21 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: password-manager-db
restart: always
environment:
POSTGRES_DB: passwords_db
POSTGRES_USER: ${DB_USER:-pguser}
POSTGRES_PASSWORD: ${DB_PASSWORD:-secret}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-pguser} -d passwords_db"]
interval: 10s
timeout: 5s
retries: 5
api:
build: .
container_name: password-manager-api
restart: always
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql://${DB_USER:-pguser}:${DB_PASSWORD:-secret}@postgres:5432/passwords_db
PORT: 4000
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
ACCESS_TOKEN_EXPIRES_IN: 15m
REFRESH_TOKEN_EXPIRES_IN: 7d
ports:
- "4000:4000"
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
volumes:
postgres_data: