-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (44 loc) · 1.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
46 lines (44 loc) · 1.44 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
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: openkey
POSTGRES_PASSWORD: openkey
POSTGRES_DB: openkey
volumes:
- openkey_pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openkey -d openkey"]
interval: 5s
timeout: 5s
retries: 10
api:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql+asyncpg://openkey:openkey@db:5432/openkey
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET — generate with openssl rand -hex 32}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-15}
REFRESH_TOKEN_EXPIRE_DAYS: ${REFRESH_TOKEN_EXPIRE_DAYS:-7}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000,http://localhost:8080,http://127.0.0.1:8080}
CORS_ALLOW_BROWSER_EXTENSIONS: ${CORS_ALLOW_BROWSER_EXTENSIONS:-true}
AUTH_RATE_LIMIT_REQUESTS: ${AUTH_RATE_LIMIT_REQUESTS:-10}
AUTH_RATE_LIMIT_WINDOW_SECONDS: ${AUTH_RATE_LIMIT_WINDOW_SECONDS:-60}
TRUST_PROXY_HEADERS: ${TRUST_PROXY_HEADERS:-false}
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
volumes:
openkey_pgdata: