mikmc5/static-reference
0
1# Use the official Python image as the base image2FROM python:3.10-slim3 4# Set the working directory in the container5WORKDIR /app6 7# Install system dependencies (e.g., for building wheel, working with requests, etc.)8RUN apt-get update && apt-get install -y --no-install-recommends \9 gcc \10 libpq-dev \11 && rm -rf /var/lib/apt/lists/*12 13# Install Python dependencies14COPY requirements.txt .15RUN pip install --no-cache-dir -r requirements.txt16 17# Copy the application code into the container18COPY . /app/19 20# Expose the port the app will run on21EXPOSE 8022 23# Set the environment variable for Python to run in optimized mode24ENV PYTHONUNBUFFERED 125 26# Install Uvicorn and Gunicorn for serving the app with FastAPI27RUN pip install uvicorn gunicorn28 29# Start the FastAPI app using Gunicorn with the Uvicorn worker class30CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "main:app"]31 