Add Docker support (Dockerfile, docker-compose.yml, .dockerignore)
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
# Git
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Python
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.egg-info
|
||||||
|
.pytest_cache
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# Downloads (keep directory but not files)
|
||||||
|
downloads/*
|
||||||
|
!downloads/.gitkeep
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
nohup.out
|
||||||
|
|
||||||
|
# HAR files (large)
|
||||||
|
*.har
|
||||||
|
|
||||||
|
# Test files
|
||||||
|
test_*.py
|
||||||
|
*.test.*
|
||||||
|
do_fix.py
|
||||||
|
do_fix.sh
|
||||||
|
|
||||||
|
# OS files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
ffmpeg \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copy application files
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install Python dependencies
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt 2>/dev/null || pip install --no-cache-dir \
|
||||||
|
flask \
|
||||||
|
requests \
|
||||||
|
gunicorn \
|
||||||
|
m3u8 \
|
||||||
|
pypdl \
|
||||||
|
python-slugify \
|
||||||
|
yt-dlp \
|
||||||
|
2>/dev/null || true
|
||||||
|
|
||||||
|
# Create downloads directory
|
||||||
|
RUN mkdir -p /app/downloads /app/cookies
|
||||||
|
|
||||||
|
# Expose port
|
||||||
|
EXPOSE 8770
|
||||||
|
|
||||||
|
# Run with gunicorn for production
|
||||||
|
CMD ["gunicorn", "--bind", "0.0.0.0:8770", "--workers", "2", "--threads", "4", "app:app"]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
services:
|
||||||
|
xstream-downloader:
|
||||||
|
build: .
|
||||||
|
container_name: xstream-downloader
|
||||||
|
ports:
|
||||||
|
- "8770:8770"
|
||||||
|
volumes:
|
||||||
|
- ./downloads:/app/downloads
|
||||||
|
- ./cookies:/app/cookies
|
||||||
|
environment:
|
||||||
|
- FLASK_ENV=production
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8770/"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 10s
|
||||||
Reference in New Issue
Block a user