-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (37 loc) · 946 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (37 loc) · 946 Bytes
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
version: "3.9"
services:
postgres:
image: postgres:16-alpine
container_name: rust-notes-db
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rust_notes_api
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
api:
build: .
container_name: rust-notes-api
restart: unless-stopped
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/rust_notes_api
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
JWT_EXPIRATION_DAYS: "7"
HOST: "0.0.0.0"
PORT: "3000"
RUST_LOG: rust_notes_api=debug,tower_http=debug
depends_on:
postgres:
condition: service_healthy
volumes:
postgres_data: