Skip to content

Commit

Permalink
[OPT-928] Refactor Dockerfile.application to use multistage approach.
Browse files Browse the repository at this point in the history
  • Loading branch information
daFont-iriusrisk committed Sep 20, 2023
1 parent 890de5e commit d093915
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions deployment/Dockerfile.application
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-alpine
FROM python:3.8-alpine as builder

WORKDIR /usr/src/app

Expand All @@ -15,9 +15,21 @@ COPY . .

RUN pip install .

RUN rm -r ../app/*

# Remove not needed dependencies for runtime
RUN apk del git geos-dev re2-dev py3-pybind11-dev
FROM python:3.8-alpine

WORKDIR /app

RUN apk update && \
apk add libmagic && \
apk add re2 && \
apk add graphviz && \
apk add lapack && \
apk add cblas && \
apk add geos \

COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages

COPY --from=builder /usr/local/bin/startleft /usr/local/bin/startleft

CMD ["startleft", "server", "--host", "0.0.0.0"]
2 changes: 1 addition & 1 deletion docs/integration/Quickstart-Guide-for-Integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ git checkout release/1.5.0

Now, we can create the StartLeft image:
```shell
docker build . -f deployment/Dockerfile.docs.application.application -t startleft
docker build . -f deployment/Dockerfile.application -t startleft
```

And, finally, we can run the docker container for the image we have just generated. Notice that you can select the
Expand Down

0 comments on commit d093915

Please sign in to comment.