forked from getmydia/mydia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
88 lines (79 loc) · 2.53 KB
/
docker-compose.postgres.yml
File metadata and controls
88 lines (79 loc) · 2.53 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Example Docker Compose configuration for Mydia with PostgreSQL
#
# This file demonstrates how to deploy Mydia with PostgreSQL instead of SQLite.
# Copy and customize this file for your deployment.
#
# Quick start:
# 1. Copy this file to docker-compose.yml
# 2. Update environment variables (especially passwords and secrets)
# 3. Run: docker compose up -d
#
# For SQLite deployments, see the main README.md
services:
postgres:
image: postgres:16-alpine
container_name: mydia_postgres
environment:
POSTGRES_USER: mydia
POSTGRES_PASSWORD: changeme # IMPORTANT: Change this!
POSTGRES_DB: mydia
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mydia -d mydia"]
interval: 10s
timeout: 5s
retries: 5
mydia:
# Use the PostgreSQL variant of the Mydia image
image: ghcr.io/getmydia/mydia:latest-pg
container_name: mydia
depends_on:
postgres:
condition: service_healthy
environment:
# Phoenix configuration
PHX_HOST: localhost # Change to your domain
PORT: 4000
SECRET_KEY_BASE: "changeme" # Generate with: mix phx.gen.secret
# PostgreSQL database configuration
DATABASE_TYPE: postgres
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: mydia
DATABASE_USER: mydia
DATABASE_PASSWORD: changeme # IMPORTANT: Must match POSTGRES_PASSWORD above
# Guardian JWT secret (for API tokens)
GUARDIAN_SECRET_KEY: "changeme" # Generate with: mix guardian.gen.secret
# Optional: Metadata relay URL (for fetching TV/movie metadata)
METADATA_RELAY_URL: https://metadata-relay.arsfeld.dev
# Optional: OIDC authentication
# OIDC_ISSUER: https://your-oidc-provider.com
# OIDC_CLIENT_ID: your-client-id
# OIDC_CLIENT_SECRET: your-client-secret
# Optional: Feature flags
# ENABLE_PLAYBACK: "true"
# ENABLE_CARDIGANN: "true"
# Optional: Logging
# LOG_LEVEL: info
ports:
- "4000:4000"
volumes:
# Persist configuration data
- mydia_config:/config
# Mount your media libraries (add as needed)
- /path/to/movies:/media/movies:ro
- /path/to/tv:/media/tv:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 3s
start_period: 40s
retries: 3
volumes:
postgres_data:
driver: local
mydia_config:
driver: local