|
FROM python:3.10-slim |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
DEBIAN_FRONTEND=noninteractive \ |
|
PATH="/home/appuser/.local/bin:${PATH}" |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
ffmpeg \ |
|
libsm6 \ |
|
libxext6 \ |
|
fontconfig && \ |
|
apt-get clean && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN mkdir -p /usr/local/share/fonts/truetype/mycustomfonts |
|
COPY assets/fonts/arial.ttf /usr/local/share/fonts/truetype/mycustomfonts/arial.ttf |
|
RUN fc-cache -f -s -v |
|
|
|
|
|
ARG APP_USER_UID=1000 |
|
ARG APP_USER_GID=1000 |
|
RUN groupadd --gid $APP_USER_GID appgroup && \ |
|
useradd --uid $APP_USER_UID --gid appgroup --shell /bin/bash --create-home appuser |
|
|
|
|
|
RUN mkdir -p /home/appuser/app && chown appuser:appgroup /home/appuser/app |
|
WORKDIR /home/appuser/app |
|
|
|
|
|
COPY --chown=appuser:appgroup requirements.txt ./ |
|
USER appuser |
|
|
|
RUN python -m pip install --no-cache-dir --upgrade pip && \ |
|
python -m pip install --no-cache-dir -r requirements.txt --verbose |
|
|
|
|
|
RUN mkdir -p temp_cinegen_media && chmod 775 temp_cinegen_media |
|
|
|
|
|
COPY --chown=appuser:appgroup . . |
|
|
|
EXPOSE 8501 |
|
CMD ["streamlit", "run", "app.py", "--server.headless=true", "--server.port=8501", "--server.fileWatcherType=none"] |