-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (90 loc) · 4.06 KB
/
docker-compose.yml
File metadata and controls
93 lines (90 loc) · 4.06 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
services:
db:
image: postgres:16-alpine
container_name: docker-archiver-db
environment:
TZ: ${TZ:-Europe/Berlin}
POSTGRES_DB: docker_archiver
POSTGRES_USER: archiver
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme123}
# Use a host bind mount for Postgres data so it's easy to inspect/backup locally
volumes:
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U archiver -d docker_archiver"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
networks:
- archiver-net
redis:
image: "redis:7-alpine"
restart: unless-stopped
volumes:
- ./redis-data:/data
networks:
- archiver-net
app:
image: drgimpfen/docker-archiver:latest
container_name: docker-archiver-app
environment:
TZ: ${TZ:-Europe/Berlin}
DATABASE_URL: postgresql://archiver:${DB_PASSWORD:-changeme123}@db:5432/docker_archiver
SECRET_KEY: ${SECRET_KEY:-change-this-secret-key-in-production}
# FLASK_ENV: production
# Redis for cross-worker SSE
REDIS_URL: "redis://redis:6379/0"
# Gunicorn (optional) - commented example overrides
# If you want to control Gunicorn sizing explicitly, uncomment and set below:
# GUNICORN_WORKERS: "" # set explicit number of workers (overrides auto sizing)
# GUNICORN_MAX_WORKERS: "8" # max workers when using automatic sizing (default 8)
# GUNICORN_THREADS: "2" # threads per worker (default 2)
# GUNICORN_TIMEOUT: "300" # worker timeout in seconds (default 300)
# Example environment variables (recommended: place in a .env file or set in your environment)
# LOG_LEVEL: ${LOG_LEVEL:-INFO} # Global log level: DEBUG, INFO, WARNING, ERROR
# SHOW_ONDISK_ARCHIVE_SIZE: ${SHOW_ONDISK_ARCHIVE_SIZE:-0} # Enable showing on-disk archive sizes in Dashboard
# DB_PASSWORD: ${DB_PASSWORD:-changeme123} # Optional: used by DATABASE_URL when referenced
# SCHEDULE_MISFIRE_GRACE: ${SCHEDULE_MISFIRE_GRACE:-300} # seconds to consider a misfire grace window
# DB_WAIT_RETRIES: ${DB_WAIT_RETRIES:-30} # Used by tools/wait_for_db.py
# DB_WAIT_DELAY: ${DB_WAIT_DELAY:-1.0} # Delay between retries (seconds)
# DOWNLOADS_AUTO_GENERATE_ON_ACCESS: ${DOWNLOADS_AUTO_GENERATE_ON_ACCESS:-false} # Downloads: allow optional auto-generation when a public link is accessed
# DOWNLOADS_AUTO_GENERATE_ON_STARTUP: ${DOWNLOADS_AUTO_GENERATE_ON_STARTUP:-false} # Downloads: optionally generate missing downloads on container start (true/false)
volumes:
# Docker socket for container management
- /var/run/docker.sock:/var/run/docker.sock
# Archive output directory (bind mount - adjust to your setup)
- ./archives:/archives
# Job logs (detached subprocess stdout/stderr) - REQUIRED host bind mount
# Map a host folder into the container so job logs persist outside the container
- ./logs:/var/log/archiver
# Persistent downloads so prepared archives survive container restarts - REQUIRED
- ./downloads:/tmp/downloads
# Stack directories - automatically detected from volume mounts
# Add bind mounts for your stack directories here
# The container will automatically scan these for Docker Compose files
# Examples for different setups:
# - /opt/stacks:/opt/stacks # Default location
# - /srv/docker/stacks:/srv/docker/stacks # Systemd/docker-compose location
# - /home/user/docker:/home/user/docker # User home directory
#
# Add your stack directory mounts here:
- /opt/stacks:/opt/stacks
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
networks:
- archiver-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
archiver-net:
driver: bridge