File size: 1,012 Bytes
5797023 63c5a26 c7b1ae2 5797023 c7b1ae2 5797023 1d2b7ef aa5a346 5797023 2ea4c2e 5797023 1d2b7ef c7b1ae2 5797023 63334ed 5797023 e5f1c8b |
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 28 29 30 31 32 33 34 35 |
# Use the official Python 3.9 slim image as the base
FROM python:3.9-slim
# Set environment variables to prevent Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Set the working directory inside the container
WORKDIR /app
# Install system dependencies (if any)
# Uncomment the following lines if your application requires additional system packages
# RUN apt-get update && apt-get install -y \
# build-essential \
# libssl-dev \
# libffi-dev \
# && rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY requirements.txt .
# Upgrade pip to the latest version
RUN pip install --upgrade pip
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code into the container
COPY . .
# Expose port 8000 to the host
EXPOSE 8000
# Define the default command to run the application using Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |