| # Start from a Python base image (choose a version matching your needs) | |
| FROM python:3.10-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Install OS-level dependencies needed for bcrypt and potentially other packages | |
| # This is for Debian-based images like python:3.10-slim | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libffi-dev \ | |
| python3-dev \ | |
| # Add any other OS packages your app might need | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements file into the container | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| # Using --no-cache-dir can help ensure fresh installs | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of your application code into the container | |
| COPY . . | |
| # Expose the port Streamlit runs on (default is 8501) | |
| EXPOSE 8501 | |
| # Command to run your Streamlit application | |
| # Ensure app.py is your main Streamlit script | |
| CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] |