Fastapi/Dockerfile
User Name 3a168404ca init
2025-06-07 23:27:56 +02:00

17 lines
529 B
Docker

# Step 1: Use an official Python runtime as the base image
FROM python:3.9-slim
# Step 2: Set the working directory inside the container
WORKDIR /app
# Step 3: Copy the current directory contents into the container
COPY . /app
# Step 4: Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Step 5: Expose port 8000 to communicate with the outside world
EXPOSE 8000
# Step 6: Define the command to run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]