Emperor2004's picture
Update Dockerfile
136d590 verified
raw
history blame contribute delete
842 Bytes
# Use a lightweight official Python image as the base
FROM python:3.9-slim
# Set the working directory inside the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt ./
# Install the dependencies from requirements.txt
# The '--no-cache-dir' option is a good practice to reduce image size
RUN pip install --no-cache-dir -r requirements.txt
# Copy all the project files from your local machine to the container's working directory
COPY . .
# Expose the port on which Streamlit will run (default is 8501)
EXPOSE 8501
# The command to run when the container starts
# --server.port=8501: Sets the port to 8501, matching the EXPOSE instruction
# --server.address=0.0.0.0: Makes the app accessible from any IP address
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]