testtttttttttt / Dockerfile
mousvai's picture
Update Dockerfile
2b49027 verified
raw
history blame contribute delete
875 Bytes
# Use the official Python base image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Upgrade pip and install necessary system dependencies
RUN pip install --no-cache-dir --upgrade pip
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git && rm -rf /var/lib/apt/lists/*
# Copy the requirements file first to leverage Docker cache
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy all other project files and folders (app.py, images, Resources, etc.) into the container
COPY . .
# Expose the port Streamlit runs on
EXPOSE 8501
# Health check to see if the app is running
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
# Command to run your Streamlit application
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]