Spaces:
Running
Running
move to Docker
Browse files- .dockerignore +52 -0
- Dockerfile +47 -0
- README.md +2 -3
.dockerignore
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
*.so
|
| 6 |
+
.Python
|
| 7 |
+
*.egg-info/
|
| 8 |
+
dist/
|
| 9 |
+
build/
|
| 10 |
+
.venv/
|
| 11 |
+
venv/
|
| 12 |
+
env/
|
| 13 |
+
ENV/
|
| 14 |
+
|
| 15 |
+
# Testing
|
| 16 |
+
.pytest_cache/
|
| 17 |
+
.coverage
|
| 18 |
+
htmlcov/
|
| 19 |
+
*.cover
|
| 20 |
+
.hypothesis/
|
| 21 |
+
|
| 22 |
+
# IDE
|
| 23 |
+
.vscode/
|
| 24 |
+
.idea/
|
| 25 |
+
*.swp
|
| 26 |
+
*.swo
|
| 27 |
+
*~
|
| 28 |
+
|
| 29 |
+
# Git
|
| 30 |
+
.git/
|
| 31 |
+
.gitignore
|
| 32 |
+
|
| 33 |
+
# Documentation
|
| 34 |
+
*.md
|
| 35 |
+
!README.md
|
| 36 |
+
|
| 37 |
+
# Environment files (should be provided at runtime)
|
| 38 |
+
.env
|
| 39 |
+
.env.local
|
| 40 |
+
|
| 41 |
+
# Test data (large video files)
|
| 42 |
+
tests/data/
|
| 43 |
+
|
| 44 |
+
# Poetry (keep these for Docker build)
|
| 45 |
+
# poetry.lock
|
| 46 |
+
# pyproject.toml
|
| 47 |
+
|
| 48 |
+
# Other
|
| 49 |
+
.DS_Store
|
| 50 |
+
*.log
|
| 51 |
+
lefthook.yml
|
| 52 |
+
|
Dockerfile
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.12 slim image as base
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
# FFmpeg is required for video processing (MoviePy, OpenCV)
|
| 9 |
+
# Build tools are needed for some Python packages
|
| 10 |
+
# curl is needed for Poetry installation
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
ffmpeg \
|
| 13 |
+
libsm6 \
|
| 14 |
+
libxext6 \
|
| 15 |
+
libxrender-dev \
|
| 16 |
+
libgomp1 \
|
| 17 |
+
build-essential \
|
| 18 |
+
curl \
|
| 19 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
+
|
| 21 |
+
# Install Poetry
|
| 22 |
+
# Using the official installer and configuring it to not create a virtual environment
|
| 23 |
+
RUN pip install --no-cache-dir poetry && \
|
| 24 |
+
poetry config virtualenvs.create false
|
| 25 |
+
|
| 26 |
+
# Copy Poetry configuration files
|
| 27 |
+
COPY pyproject.toml poetry.lock* ./
|
| 28 |
+
|
| 29 |
+
# Install dependencies using Poetry
|
| 30 |
+
# Only install production dependencies (exclude dev dependencies)
|
| 31 |
+
RUN poetry install --no-interaction --no-ansi --without dev
|
| 32 |
+
|
| 33 |
+
# Copy application code
|
| 34 |
+
COPY src/ ./src/
|
| 35 |
+
|
| 36 |
+
# Set environment variables
|
| 37 |
+
# Note: These should be provided at runtime via docker run -e or docker-compose
|
| 38 |
+
ENV PYTHONUNBUFFERED=1
|
| 39 |
+
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 40 |
+
ENV GRADIO_SERVER_PORT=7860
|
| 41 |
+
|
| 42 |
+
# Expose Gradio default port
|
| 43 |
+
EXPOSE 7860
|
| 44 |
+
|
| 45 |
+
# Run the application using Poetry
|
| 46 |
+
CMD ["poetry", "run", "python", "src/app/app.py"]
|
| 47 |
+
|
README.md
CHANGED
|
@@ -3,9 +3,8 @@ title: Vidzly
|
|
| 3 |
emoji: 🎬
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
app_file: src/app/app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
|
|
|
| 3 |
emoji: 🎬
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|