From c702d99d26d982edbf432b3873fcb544771aa464 Mon Sep 17 00:00:00 2001 From: Jacob Windsor Date: Wed, 19 Feb 2025 11:26:18 +0100 Subject: [PATCH] Add a dockerfile --- backend/Dockerfile | 20 ++++++++++++++++++++ backend/requirements.txt | 3 --- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 backend/Dockerfile delete mode 100644 backend/requirements.txt diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..d70e01d --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,20 @@ +# Use the official Python image from the Docker Hub +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the pyproject.toml file to the container +COPY pyproject.toml ./ + +# Install the dependencies using pyproject.toml +RUN pip install --no-cache-dir . + +# Copy the rest of the application code to the container +COPY . . + +# Expose the port the app runs on +EXPOSE 8000 + +# Command to run the application +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/backend/requirements.txt b/backend/requirements.txt deleted file mode 100644 index 6f745c3..0000000 --- a/backend/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -fastapi -pydantic -uvicorn \ No newline at end of file