naomi / Dockerfile
Mimi
asdf
cd33363
raw
history blame
659 Bytes
FROM python:3.12
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
COPY . $HOME/app
ENV HF_TOKEN=${HF_TOKEN}
RUN echo "The token is: ${HF_TOKEN}"
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
# Switch to non-root user
USER user
RUN chown -R user:user $HOME
WORKDIR $HOME/app
# Expose Streamlit port
EXPOSE 7860
# Login to Hugging Face at runtime & Start app
CMD huggingface-cli login --token $HF_TOKEN && \
streamlit run app.py \
--server.headless true \
--server.enableCORS false \
--server.enableXsrfProtection false \
--server.fileWatcherType none