2024-12-10 14:45:01 +01:00
|
|
|
# Base image with Python 3.11
|
|
|
|
|
FROM python:3.11-slim
|
|
|
|
|
|
|
|
|
|
# Set the working directory in the container
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy the requirements file to the working directory
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
# Install Python dependencies
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# Copy the rest of the application code
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2024-12-10 15:16:17 +01:00
|
|
|
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
2024-12-20 10:35:54 +01:00
|
|
|
EXPOSE 9212
|
2024-12-10 14:45:01 +01:00
|
|
|
|
2024-12-10 15:16:17 +01:00
|
|
|
# Command to run the FastAPI application
|
2024-12-20 10:35:54 +01:00
|
|
|
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "9212", "--workers", "1"]
|