-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
114 lines (103 loc) · 3 KB
/
Copy pathdocker-stack.yml
File metadata and controls
114 lines (103 loc) · 3 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# file: docker-stack.yml
# Docker Stack configuration for production deployment
# Deploy with: docker stack deploy -c docker-stack.yml subtitle-manager
services:
subtitle-manager:
image: ghcr.io/jdfalk/subtitle-manager:latest
ports:
# Map port 9555 on the host to the application's default port 8080
- "9555:8080"
volumes:
# Configuration and database storage (use named volumes in production)
- subtitle-manager-config:/config
# Media libraries (adjust paths to your actual media locations)
- /mnt/media/movies:/media/movies
- /mnt/media/tv:/media/tv
# Subtitle storage
- subtitle-manager-subtitles:/subtitles
- /var/run/docker.sock:/var/run/docker.sock
environment:
# Core configuration with SM_ prefix (required by Viper)
- SM_LOG_LEVEL=info
- SM_CONFIG_FILE=/config/subtitle-manager.yaml
- SM_DB_PATH=/config/subtitle-manager.db
- SM_DB_BACKEND=sqlite
# Performance tuning for production
- SM_BATCH_WORKERS=8
- SM_SCAN_WORKERS=8
# - ENABLE_WHISPER=1
# Optional: Automatic admin user creation on first run
# - SM_ADMIN_USER=admin
# - SM_ADMIN_PASSWORD=changeme
# Optional: Configure ffmpeg path if needed
# - SM_FFMPEG_PATH=/usr/bin/ffmpeg
# API Keys - Use Docker secrets in production for security
# - SM_GOOGLE_API_KEY_FILE=/run/secrets/google_api_key
# - SM_OPENAI_API_KEY_FILE=/run/secrets/openai_api_key
# Production deployment configuration
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
resources:
limits:
memory: 1G
cpus: "1.0"
reservations:
memory: 512M
cpus: "0.5"
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
order: stop-first
rollback_config:
parallelism: 1
delay: 5s
failure_action: pause
order: stop-first
networks:
- subtitle-manager-network
# Healthcheck for production monitoring
healthcheck:
test:
[
"CMD",
"sh",
"-c",
"PORT=$${SM_HTTP_PORT:-8080} && wget --quiet --tries=1 --spider http://localhost:$$PORT/api/system",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Use Docker secrets for sensitive data
# secrets:
# - google_api_key
# - openai_api_key
networks:
subtitle-manager-network:
driver: overlay
attachable: true
volumes:
subtitle-manager-config:
driver: local
driver_opts:
type: none
o: bind
device: /opt/subtitle-manager/config
subtitle-manager-subtitles:
driver: local
driver_opts:
type: none
o: bind
device: /opt/subtitle-manager/subtitles
# Optional: Define secrets for production
# secrets:
# google_api_key:
# external: true
# openai_api_key:
# external: true