-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from qinguoyi/feat-downsize-model-load
Downsize model-loader image
- Loading branch information
Showing
1 changed file
with
18 additions
and
8 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,21 +1,31 @@ | ||
FROM python:3.10-alpine | ||
FROM python:3.10-alpine as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
COPY llmaz/ llmaz/ | ||
ENV POETRY_VIRTUALENVS_CREATE false | ||
|
||
RUN apk add --no-cache \ | ||
build-base \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
py3-pip \ | ||
bash | ||
bash \ | ||
&& pip install --no-cache-dir poetry && poetry install --no-dev | ||
|
||
RUN pip install --no-cache-dir poetry | ||
|
||
RUN poetry config virtualenvs.create false | ||
COPY pyproject.toml poetry.lock . | ||
RUN poetry install --no-dev | ||
FROM python:3.10-alpine | ||
|
||
WORKDIR /workspace | ||
|
||
RUN apk add --no-cache \ | ||
bash | ||
|
||
COPY --from=builder /workspace /workspace | ||
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages | ||
COPY --from=builder /usr/local/bin/ /usr/local/bin/ | ||
|
||
COPY llmaz/ llmaz/ | ||
RUN mv llmaz/main.py main.py | ||
|
||
CMD ["poetry", "run", "python", "main.py"] | ||
CMD ["python", "main.py"] |