generated from egvimo/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
7 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,15 +1,24 @@ | ||
FROM python:3.11-bookworm | ||
FROM python:3.11-bookworm as build | ||
|
||
RUN apt update && apt install -y libapt-pkg-dev && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
ENV PIPENV_VENV_IN_PROJECT=1 | ||
|
||
RUN apt update && \ | ||
apt install -y libapt-pkg-dev && \ | ||
pip install pipenv | ||
|
||
WORKDIR /app | ||
WORKDIR /build | ||
|
||
COPY Pipfile Pipfile.lock ./ | ||
|
||
COPY Pipfile Pipfile.lock app.py apt_info.py ./ | ||
RUN pipenv sync | ||
|
||
FROM build | ||
|
||
WORKDIR /app | ||
|
||
RUN pipenv install --deploy --ignore-pipfile | ||
COPY --from=build /build/.venv/ ./.venv/ | ||
COPY app.py apt_info.py ./ | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["pipenv", "run", "uvicorn", "app:app", "--host", "0.0.0.0", "--no-access-log"] | ||
CMD ["/app/.venv/bin/uvicorn", "app:app", "--host", "0.0.0.0", "--no-access-log"] |