# ============================================================================= # VideoPress — docker-compose.yml # ============================================================================= # # Quick start: # 1. Edit MEDIA_HOST_PATH below (or set it as a shell variable before running) # 2. docker compose up -d # 3. Open http://localhost:8080 # # All configuration lives in the 'environment' section — no .env file needed # for basic usage, though a .env file is supported (see comments below). # ============================================================================= services: videopress: build: context: . dockerfile: Dockerfile # ── Alternatively, use a pre-built image: ─────────────────────────────── # image: videopress:latest container_name: videopress # Run as UID:GID 1000:1000 (matches the 'appuser' created in the Dockerfile). # This ensures the container can write to bind-mounted host directories # that are owned by UID 1000. user: "1000:1000" restart: unless-stopped # ── Port mapping ───────────────────────────────────────────────────────── # Format: "HOST_PORT:CONTAINER_PORT" # The UI and REST API are served on the same port — no separate API port # is required. Change the host port (left side) as needed. ports: - "8080:8080" # ── Volume mapping ──────────────────────────────────────────────────────── # Map the directory on your HOST that contains the video files into the # container at /media (MEDIA_ROOT). # # *** Change /path/to/your/videos to the real path on your host. *** # # You can also set MEDIA_HOST_PATH as an environment variable before # running docker compose: # export MEDIA_HOST_PATH=/mnt/nas/videos && docker compose up -d # # IMPORTANT — before first run, create the data directory on the HOST # and give it to UID 1000 (the container's non-root user) so SQLite can # write the settings database: # # mkdir -p ./data # chown 1000:1000 ./data # # If you skip this step Docker will create ./data as root and the # container will fail to start with "unable to open database file". volumes: - ${MEDIA_HOST_PATH:-/path/to/your/videos}:/media - ./data:/data # ── Environment variables ───────────────────────────────────────────────── environment: # Path *inside the container* where videos are accessible. # Must match the right-hand side of the volume mount above. MEDIA_ROOT: /media # SQLite database path inside the container. # Must match the right-hand side of the ./data:/data volume mount. DB_PATH: /data/videopress.db # TCP port Gunicorn listens on (must match EXPOSE in Dockerfile and # the right-hand side of the ports mapping above). PORT: 8080 # Gunicorn log level: debug | info | warning | error | critical LOG_LEVEL: info # ── Resource limits (optional — uncomment to enable) ───────────────────── # Compressing large video files is CPU-intensive. Limits prevent the # container from starving other workloads on the host. # deploy: # resources: # limits: # cpus: '4' # memory: 2G # reservations: # cpus: '1' # memory: 512M # ── Health check ────────────────────────────────────────────────────────── healthcheck: test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/')"] interval: 30s timeout: 10s retries: 3 start_period: 15s # ── Logging ─────────────────────────────────────────────────────────────── logging: driver: json-file options: max-size: "10m" max-file: "3"