Skip to main content

Prerequisites

Quickstart

The fastest way to get started is with the docker-compose.yaml file included in the repository. It pulls the pre-built image from Docker Hub automatically.
docker-compose up
To run in detached (background) mode:
docker-compose up -d
Add your recording URLs to config/URL_config.ini before starting the container. The config directory is mounted as a volume, so the file must exist on the host before the container launches.

docker-compose.yaml

The full compose file used to run the recorder:
version: '3.8'

services:
  app:
    image: ihmily/douyin-live-recorder:latest
    environment:
      - TERM=xterm-256color
    tty: true
    stdin_open: true
    #build: .
    volumes:
      - ./config:/app/config
      - ./logs:/app/logs
      - ./backup_config:/app/backup_config
      - ./downloads:/app/downloads
    restart: always

Volume mounts

Host pathContainer pathPurpose
./config/app/configConfiguration files, including URL_config.ini and config.ini
./logs/app/logsRuntime log files
./backup_config/app/backup_configAutomatic config backups
./downloads/app/downloadsRecorded video output
All four directories are created automatically by Docker Compose if they do not already exist on the host.

Docker Hub image

The official pre-built image is published at:
ihmily/douyin-live-recorder
The compose file defaults to the latest tag. To pin a specific version, change the image field:
image: ihmily/douyin-live-recorder:v4.0.7
The Docker Hub image may not always reflect the very latest commit on the main branch. If you need the most recent code, build a custom image from source instead.

Building a custom image from source

To build and run from the local source tree:
  1. Edit docker-compose.yaml — change the image name and uncomment the build line:
    image: douyin-live-recorder:latest
    #build: .    <-- uncomment this line
    
  2. Build the image and start the container:
    docker build -t douyin-live-recorder:latest .
    docker-compose up
    
    Or build and start in a single step:
    docker-compose -f docker-compose.yaml up
    

Viewing logs

To follow the container output in real time:
docker-compose logs -f

Stopping the container

docker-compose stop
Do not forcefully kill or interrupt a running container while recordings are in progress. Abrupt termination will corrupt the video files currently being written.
Use ts as the recording format in config/config.ini. TS is a container format that is resilient to unexpected interruptions — if recording does stop abruptly, the file up to that point remains playable.

Build docs developers (and LLMs) love