From 9d4049d7ba43d70dce535e4b1cf89de2363ec924 Mon Sep 17 00:00:00 2001 From: mxmin01 Date: Tue, 7 Jan 2025 22:51:05 +0100 Subject: [PATCH] Create Dockerfile --- api/Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 api/Dockerfile diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 00000000..433c0fcc --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,21 @@ +# Use a lightweight Python image +FROM python:3.9-slim + +# Set the working directory +WORKDIR /usr/src/app + +# Copy the requirements file and install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the API code into the container +COPY . . + +# Expose the API server port +EXPOSE 8000 + +# Set the environment variable for AWS keys (optional for .env) +ENV ENV_FILE_PATH=.env + +# Start the API server +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]