add docker

This commit is contained in:
root
2026-09-26 14:24:05 +08:00
parent 9dfc684869
commit 993fd8f217
5 changed files with 66 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
.git
.agents
.codex
downloads
**/.venv
**/.venv_network_failed
**/__pycache__
**/.pytest_cache
**/*.egg-info
**/*.py[cod]
+1
View File
@@ -0,0 +1 @@
downloads/
+34
View File
@@ -0,0 +1,34 @@
FROM python:3.12-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
ca-certificates \
ffmpeg \
openssl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY N_m3u8DL_py/pyproject.toml N_m3u8DL_py/
COPY N_m3u8DL_py/src N_m3u8DL_py/src
COPY m3u8downloaderd/pyproject.toml m3u8downloaderd/
COPY m3u8downloaderd/src m3u8downloaderd/src
RUN python -m pip install --upgrade 'setuptools>=68' \
&& python -m pip install --no-build-isolation \
/app/N_m3u8DL_py \
/app/m3u8downloaderd
RUN mkdir --parents /downloads
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "from urllib.request import urlopen; urlopen('http://127.0.0.1:8000/api/bootstrap', timeout=3)"
ENTRYPOINT ["python", "-m", "m3u8downloaderd"]
CMD ["--host", "0.0.0.0", "--port", "8000", "--download-root", "/downloads", "--max-active-downloads", "2"]
+10
View File
@@ -0,0 +1,10 @@
services:
m3u8downloaderd:
build:
context: .
dockerfile: Dockerfile
ports:
- "8123:8000"
volumes:
- /mnt/6THD/jellyfin-data/lost.found/keys:/downloads
restart: unless-stopped
+11
View File
@@ -3,6 +3,17 @@
`m3u8downloaderd` is an in-memory local-network web interface for the adjacent `m3u8downloaderd` is an in-memory local-network web interface for the adjacent
`N_m3u8DL_py` package. It requires Python 3.10+ and a system `ffmpeg`. `N_m3u8DL_py` package. It requires Python 3.10+ and a system `ffmpeg`.
## Docker
From the repository root, start the service and build its image when needed:
```bash
docker-compose up
```
Open `http://127.0.0.1:8000`. Downloaded files are written to the repository's
`downloads/` directory. Use `docker-compose down` to stop the service.
Install both local packages into the same environment: Install both local packages into the same environment:
```bash ```bash