File size: 672 Bytes
bfd5a3c 0ca7981 bfd5a3c 0ca7981 bfd5a3c 0ca7981 bfd5a3c 0ca7981 bfd5a3c 0ca7981 bfd5a3c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory in the container
WORKDIR /app
# Install system dependencies (if any)
# RUN apt-get update && apt-get install -y <dependencies>
# Copy requirements.txt first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY app/ /app/
# Expose the port FastAPI is running on
EXPOSE 3000
# Command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"] |