diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..038d4b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Use an official Python runtime as a parent image +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# Set environment variables +# Prevents Python from writing .pyc files to disk +ENV PYTHONDONTWRITEBYTECODE 1 +# Prevents Python from buffering stdout and stderr +ENV PYTHONUNBUFFERED 1 + +# Install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the current directory contents into the container at /app +COPY main.py . + +# Make port 8000 available to the world outside this container +EXPOSE 8000 + +# Define the command to run your app using uvicorn +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file