# Use a slim Python image for a smaller container size FROM python:3.9-slim # Set up a non-root user for better security RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" ENV PYTHONUNBUFFERED=1 # Set the working directory inside the container WORKDIR /app # Copy and install the Python dependencies COPY --chown=user:user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the application source code into the container COPY --chown=user:user . . # Expose the ports for documentation and discovery # The actual mapping happens in the `docker run` command EXPOSE 7860 EXPOSE 7660 # The command that will be executed when the container starts # This launches the FastAPI application, which in turn starts the ISUP server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]