FROM python:3.10-slim # Install supervisor, our process manager RUN apt-get update && \ apt-get install -y supervisor && \ rm -rf /var/lib/apt/lists/* # Set the working directory WORKDIR /app # Copy the single requirements file COPY requirements.txt requirements.txt # Install all Python dependencies in one step RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code COPY . /app # Copy the supervisor configuration file COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Expose the ports for FastAPI (8000) and Streamlit (7860) EXPOSE 8000 EXPOSE 7860 # The main command to start the supervisor, which launches both services CMD ["supervisord", "-n"]