irenekar's picture
Update Dockerfile
d6ce31f verified
raw
history blame contribute delete
760 Bytes
# Use a base image with Python
FROM python:3.9
# Expose the port Streamlit runs on
EXPOSE 8501
# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_PORT=8501 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0
# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' streamlit_user
USER streamlit_user
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy your application code and model file
COPY app.py .
COPY mobilenetv2_single_final3.h5 .
# Command to run your Streamlit app, disabling XSRF protection
CMD ["python", "-m", "streamlit", "run", "app.py", "--server.enableXsrfProtection=false"]