Skip to content

Commit

Permalink
Merge pull request #179 from qinguoyi/feat-downsize-model-load
Browse files Browse the repository at this point in the history
Downsize model-loader image
  • Loading branch information
InftyAI-Agent authored Sep 29, 2024
2 parents 8042c31 + c345758 commit a507bdf
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Dockerfile.loader
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"]

0 comments on commit a507bdf

Please sign in to comment.