diff --git a/backend/core/Dockerfile b/backend/core/Dockerfile index f220df64888d..b481cedc6e94 100644 --- a/backend/core/Dockerfile +++ b/backend/core/Dockerfile @@ -1,14 +1,19 @@ -FROM python:3.11-bullseye +# Using a slim version for a smaller base image +FROM python:3.11-slim-bullseye -# Install GEOS library -RUN apt-get update && apt-get install -y libgeos-dev pandoc +# Install GEOS library and clean up in one step +RUN apt-get update && apt-get install -y libgeos-dev pandoc && \ + rm -rf /var/lib/apt/lists/* && apt-get clean WORKDIR /code -COPY ./requirements.txt /code/requirements.txt +# Copy just the requirements first +COPY ./requirements.txt . -RUN pip install --no-cache-dir -r /code/requirements.txt --timeout 100 +# Increase timeout might not be necessary but is retained as in original +RUN pip install --no-cache-dir -r requirements.txt --timeout 100 -COPY . /code +# Copy the rest of the application +COPY . . CMD ["uvicorn", "main:app", "--reload", "--host", "0.0.0.0", "--port", "5050"]