File size: 819 Bytes
5a42025
c0a4318
 
5a42025
 
 
 
7af728c
5a42025
c0a4318
5a42025
 
 
c0a4318
5a42025
 
c0a4318
5a42025
 
 
c0a4318
5a42025
c0a4318
 
d1cd822
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
# Use a Python base image
FROM python:3.13.5-slim

# Create a non-root user and set permissions
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR $HOME/app

# Copy and install dependencies
COPY --chown=user:user requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy application source code
COPY --chown=user:user src/ ./src/

# Set environment variables for Streamlit and Hugging Face libraries
ENV STREAMLIT_SERVER_GATHER_USAGE_STATS="false" \
    HF_HOME="/tmp/huggingface"

# Expose the port and set the entrypoint
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]