-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): improved size image (#978)
- Loading branch information
1 parent
54f82ab
commit eeffad4
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |