-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Dockerfile: updated base, two stage build, more secure, etc.
- Loading branch information
1 parent
ef13e6a
commit f02ed13
Showing
2 changed files
with
18 additions
and
9 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
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,11 +1,20 @@ | ||
FROM python:3.11-slim as build | ||
FROM python:3.12-slim as builder | ||
|
||
COPY requirements.txt ./requirements.txt | ||
RUN pip3 install -r /requirements.txt | ||
WORKDIR /app | ||
|
||
COPY wsgi.py server.py photo_inferencing.py monitoring.py score_service.py logging_util.py ./ | ||
COPY requirements.txt . | ||
|
||
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt | ||
|
||
FROM python:3.12.2-slim | ||
|
||
COPY --from=builder /app/wheels /wheels | ||
COPY --from=builder /app/requirements.txt . | ||
|
||
RUN pip install --no-cache /wheels/* | ||
|
||
COPY *.py ./ | ||
|
||
EXPOSE 6000 | ||
|
||
CMD ["gunicorn" , "--bind", "0.0.0.0:6000", "wsgi:app"] | ||
ENTRYPOINT ["gunicorn" , "--bind", "0.0.0.0:6000", "wsgi:app"] |