Add Basic Auth and optimize Docker build

This commit is contained in:
wander 2026-01-04 23:15:17 -05:00
parent 2f8ec83cd8
commit 17153f8765
3 changed files with 50 additions and 6 deletions

View file

@ -1,8 +1,17 @@
FROM python:3.11-slim
WORKDIR /app
COPY . .
# 1. Install System Deps (ffmpeg) FIRST
# These rarely change, so Docker will cache this layer forever.
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir requests flask
RUN mkdir -p /app/data
EXPOSE 5000
CMD ["python", "ta_symlink.py"]
# 2. Install Python Deps SECOND
# Only re-runs if requirements.txt changes
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3. Copy Code LAST
# Now, if you change code, only this fast step re-runs.
COPY . .
CMD ["python", "ta_symlink.py"]