add Docker entrypoint for container initialization

This commit is contained in:
DIvan2000 2025-08-14 03:38:17 +04:00
parent 6c47d7f0a6
commit a5df3133ac
5 changed files with 27 additions and 4 deletions

View File

@ -1,2 +1 @@
/data/sync_token.txt
/data/.env
/data/

3
.gitignore vendored
View File

@ -1,2 +1 @@
data/sync_token.txt
data/.env
/data/

View File

@ -4,4 +4,6 @@ RUN apt-get update && apt-get install -y gcc libffi-dev build-essential && rm -r
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "main.py"]

16
default_config.yaml Normal file
View File

@ -0,0 +1,16 @@
homeserver_url: "https://example.org"
bot_user: "@MediaBot:example.org"
bot_password: "bot_password"
trusted_homeservers:
- "example.org"
command_prefix: "!media"
download_audio:
services:
youtube:
tmp_dir: "/tmp" # Директория для временных файлов
timeout: 300 # Таймаут загрузки в секундах
proxy: none # Прокси для загрузки (например: "socks5://user:pass@host:port")
enabled: true
audio_quality: 192 # Качество аудио в kbps
max_duration: 1200 # Макс. длительность в секундах

7
entrypoint.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Копируем дефолтный config.yaml только если его нет
if [ ! -f /app/data/config.yaml ]; then
cp /app/default_config.yaml /app/data/config.yaml
fi
exec "$@"