| FROM python:3.12-slim |
|
|
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends \ |
| ffmpeg \ |
| ca-certificates \ |
| openssl && \ |
| update-ca-certificates && \ |
| rm -rf /var/lib/apt/lists/* |
|
|
| RUN useradd -m -u 1000 appuser |
|
|
| WORKDIR /app |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY . . |
|
|
| RUN mkdir -p /app/downloads && chown -R appuser:appuser /app |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends gosu && rm -rf /var/lib/apt/lists/* |
|
|
| COPY entrypoint.sh /app/entrypoint.sh |
| RUN chmod +x /app/entrypoint.sh |
|
|
| EXPOSE 7860 |
| ENV HOST=0.0.0.0 |
| ENV PORT=7860 |
| ENTRYPOINT ["/app/entrypoint.sh"] |
|
|