File size: 1,125 Bytes
9ede49e 5afbe18 ed52b73 e6ba6db 5e1192b ce859c4 e6ba6db 264ac69 e6ba6db ed52b73 e6ba6db ce859c4 111ba62 e6ba6db ed52b73 0f0f717 111ba62 5e1192b e6ba6db 0f0f717 ed52b73 264ac69 ed52b73 e6ba6db 0f0f717 ed52b73 264ac69 5e1192b 5afbe18 e6ba6db |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
FROM python:3.10-slim
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
libsm6 \
libxext6 \
fontconfig \
imagemagick && \
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
# Ensure 'assets/fonts/arial.ttf' exists in your repo
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
WORKDIR /home/appuser/app
COPY --chown=appuser:appgroup requirements.txt ./
USER appuser
ENV PATH="/home/appuser/.local/bin:${PATH}"
RUN python -m pip install --no-cache-dir --upgrade pip
RUN python -m pip install --no-cache-dir -r requirements.txt
COPY --chown=appuser:appgroup . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.headless=true", "--server.port=8501", "--server.fileWatcherType=none"] |