diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e807328 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.12-slim + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY app.py _config.py YTProcessing.py ./ + +COPY templates/ ./templates/ + +EXPOSE 5000 + +CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000", "--workers", "2"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3b8b86d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + app: + build: . + ports: + - "5000:5000" + environment: + - PORT=5000 + - HOST=0.0.0.0 + - SECRET_KEY=${SECRET_KEY:*vdfv128596456QA} + env_file: + - .env + restart: unless-stopped + depends_on: + - redis + + redis: + image: redis:7-alpine + restart: unless-stopped diff --git a/dockerignore b/dockerignore new file mode 100644 index 0000000..8f6eae9 --- /dev/null +++ b/dockerignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +*.pyo +.env +.git +.gitignore +*.md