File size: 611 Bytes
4c72cf3 c265f48 4c72cf3 c265f48 4c72cf3 c265f48 4c72cf3 bfe46dc 4c72cf3 bfe46dc c265f48 4c72cf3 bfe46dc c265f48 4c72cf3 bfe46dc |
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 |
# Base image with Python 3.9
FROM python:3.9-slim
# Create a non-root user
RUN useradd -m -u 1000 user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Switch to non-root user
USER user
# Set working directory
WORKDIR $HOME/app
# Copy project files with correct ownership
COPY --chown=user . $HOME/app
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose Streamlit port
EXPOSE 8501
# Run Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|