-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (69 loc) · 2.32 KB
/
docker-compose.yml
File metadata and controls
71 lines (69 loc) · 2.32 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
services:
postgres:
image: postgres:15-alpine
container_name: desterlib-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: desterlib_prod
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: Dockerfile
container_name: desterlib-api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
env_file:
- apps/api/.env
environment:
# Database connection variables for the startup script
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: desterlib_prod
# Application environment
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/desterlib_prod?schema=public
NODE_ENV: production
PORT: 3001
FRONTEND_URL: http://localhost:3001
# Media library path configuration
# HOST_MEDIA_PATH: The root host path for your media library (used for path mapping)
# Should match the host path in the volume mount above (before the colon)
HOST_MEDIA_PATH: /Volumes/External/Library/Media
CONTAINER_MEDIA_PATH: /media
ports:
# Bind to all interfaces (0.0.0.0) to allow mobile app connections
# Mobile apps will use the host machine's IP address
- "0.0.0.0:3001:3001"
volumes:
# Mount your media library root directory (read-only for security)
# This is the root location for all your media libraries (e.g., /Volumes/Media)
# Subdirectories like /Volumes/Media/Movies, /Volumes/Media/TV Shows, etc. should be scanned via the API
# The application automatically handles path mapping between host and container
# Clients should use host paths (e.g., /Volumes/Media/Movies) when calling the API
- /Volumes/External/Library/Media:/media:ro
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://localhost:3001/health || exit 1",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data: