Skip to content

Download videos from almost any website. Lightweight, self-hosted media downloader with a clean web UI.

HTML

Add docker-compose and harden Dockerfile

jouls021759518cf7738a
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..ee429ec
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,15 @@
+.git
+.gitignore
+downloads
+__pycache__
+*.pyc
+*.pyo
+README.md
+LICENSE
+docker-compose.yml
+Dockerfile
+.dockerignore
+.env
+.env.*
+.vscode
+.idea
diff --git a/Dockerfile b/Dockerfile
index d3dfbe9..cd5fafd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,15 +1,27 @@
FROM python:3.12-slim
+ENV PYTHONUNBUFFERED=1 \
+ PYTHONDONTWRITEBYTECODE=1
+
RUN apt-get update && \
- apt-get install -y --no-install-recommends ffmpeg && \
+ apt-get install -y --no-install-recommends ffmpeg curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
+
COPY requirements.txt .
-RUN pip install --no-cache-dir -r requirements.txt
+RUN pip install --no-cache-dir -r requirements.txt gunicorn
COPY . .
+RUN useradd -m -u 1000 reclip && \
+ mkdir -p /app/downloads && \
+ chown -R reclip:reclip /app
+USER reclip
+
EXPOSE 8899
-ENV HOST=0.0.0.0
-CMD ["python", "app.py"]
+
+HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
+ CMD curl -fsS http://localhost:8899/ || exit 1
+
+CMD ["gunicorn", "-b", "0.0.0.0:8899", "-w", "2", "--timeout", "600", "app:app"]
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..0b20fe6
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,10 @@
+services:
+ reclip:
+ build: .
+ image: reclip:latest
+ container_name: reclip
+ ports:
+ - "8899:8899"
+ volumes:
+ - ./downloads:/app/downloads
+ restart: unless-stopped