Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): improved size image #978

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading