Skip to content

Commit

Permalink
feat(docker): improved size image (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Aug 18, 2023
1 parent c227fc9 commit aa623c4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions backend/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit aa623c4

Please sign in to comment.