diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..255f49d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.env +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e8d961c..96f20fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,12 @@ FROM python:3.10 # Set the working directory in the container to /app WORKDIR /app +# Use ARG to accept the API key as a build argument +ARG API_KEY + +# Use ENV to set the API key as an environment variable +ENV API_KEY=$API_KEY + # Copy the poetry files COPY pyproject.toml poetry.lock /app/ @@ -14,9 +20,6 @@ RUN pip install poetry RUN poetry lock RUN poetry install -# Copy the .env file -COPY .env .env - # Copy the rest of the project COPY . .