Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (103 loc) · 4.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
108 lines (103 loc) · 4.74 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
# IMPORTANT NOTES:
# 1) UID/GID and folder setup:
# By default, the youtarr service runs as ROOT (UID 0, GID 0) for compatibility with existing setups.
# For improved security, you can set YOUTARR_UID and YOUTARR_GID environment variables to run the container as a non-root user.
# If you do so, ensure that the following directories exist on the host with the correct ownership/permissions before
# starting the container:
# - ./config
# - ./jobs
# - ./server/images
# - <YOUTUBE_OUTPUT_DIR> (as specified in environment variable)
# Docker will create these directories as ROOT if they do not exist!
#
# To create and set ownership/permissions, you can use the following commands:
# Example (using example YOUTUBE_OUTPUT_DIR of /path/to/youtube_videos and YOUTARR_UID/GID of 1000/1000):
# mkdir -p config jobs server/images /path/to/youtube_videos
# sudo chown -R 1000:1000 config jobs server/images /path/to/youtube_videos
#
# 2) Database setup notes:
# The default bundled MariaDB uses ./database as a bind mount for backwards compatibility.
# On Docker Desktop (Windows/macOS), ARM hosts, and some NAS/virtualized filesystems,
# bind-mounted MariaDB data can become corrupted during schema migrations. For a safer named
# volume, use docker-compose.arm.yml or run ./scripts/migrate-to-named-volume.sh
# for an existing bind-mounted install.
services:
youtarr-db:
image: mariadb:10.3
container_name: youtarr-db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-123qweasd}
MYSQL_DATABASE: ${DB_NAME:-youtarr}
MYSQL_TCP_PORT: ${DB_PORT:-3321}
# Set utf8mb4 as default for new installations
# Only set MYSQL_USER / MYSQL_PASSWORD if you configure a non-root DB_USER user in .env
# MYSQL_USER: ${DB_USER}
# MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_CHARSET: utf8mb4
MYSQL_COLLATION: utf8mb4_unicode_ci
volumes:
- ./database:/var/lib/mysql
command: --port=${DB_PORT:-3321} --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb-file-per-table=1 --innodb-large-prefix=ON
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-P", "${DB_PORT:-3321}", "-u", "${DB_USER:-root}", "-p${DB_PASSWORD:-123qweasd}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
youtarr:
image: ${YOUTARR_IMAGE:-dialmaster/youtarr:latest}
container_name: youtarr
restart: unless-stopped
# Optional: Run as specific UID:GID for security (defaults to root if not set for backwards compatibility with existing users)
user: "${YOUTARR_UID:-0}:${YOUTARR_GID:-0}"
depends_on:
youtarr-db:
condition: service_healthy
environment:
# DEPRECATED but retained for backwards compatibility with old images for now
IN_DOCKER_CONTAINER: 1
TZ: ${TZ:-UTC}
DB_HOST: ${DB_HOST:-youtarr-db}
DB_PORT: ${DB_PORT:-3321}
DB_USER: ${DB_USER:-root}
DB_PASSWORD: ${DB_PASSWORD:-123qweasd}
DB_NAME: ${DB_NAME:-youtarr}
# Optional: Disable authentication (for platforms with external auth like Elfhosted)
AUTH_ENABLED: ${AUTH_ENABLED:-}
# Optional: Seed initial admin credentials for headless deployments
AUTH_PRESET_USERNAME: ${AUTH_PRESET_USERNAME:-}
AUTH_PRESET_PASSWORD: ${AUTH_PRESET_PASSWORD:-}
# Optional: Configure Express proxy header trust
TRUST_PROXY: ${TRUST_PROXY:-}
# Optional external cookies; /app/config uses the existing mount (see docs/CONFIG.md).
YOUTARR_COOKIES_FILE: ${YOUTARR_COOKIES_FILE:-}
# Logging configuration
LOG_LEVEL: ${LOG_LEVEL:-info}
# Optional: rolling log files in config/logs (defaults: 10MB per file, 5 older files kept)
LOG_FILE_MAX_SIZE: ${LOG_FILE_MAX_SIZE:-}
LOG_FILE_MAX_COUNT: ${LOG_FILE_MAX_COUNT:-}
# This is just informational and lets the app know where the videos will be stored on the host
YOUTUBE_OUTPUT_DIR: ${YOUTUBE_OUTPUT_DIR}
# Optional: Custom data path for platforms like Elfhosted (defaults to /usr/src/app/data)
# This is the internal path where videos are downloaded inside the container and is not needed for most users
# DATA_PATH: /storage/rclone/storagebox/youtube
ports:
- "${YOUTARR_HOST_PORT:-3087}:3011"
volumes:
- ${YOUTUBE_OUTPUT_DIR}:/usr/src/app/data
- ./server/images:/app/server/images
- ./config:/app/config
- ./jobs:/app/jobs
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "--show-error", "--output", "/dev/null", "http://localhost:3011/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
default:
name: youtarr-network
# Named volume definition (used by docker-compose.arm.yml override)
volumes:
youtarr-db-data: