Skip to content

Commit

Permalink
Improve Dockerfile to cache pip dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Mar 24, 2024
1 parent d6e1bc6 commit aa2c288
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/ainu_lm_trainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ ARG HF_TOKEN
ENV TRANSFORMERS_NO_ADVISORY_WARNINGS=1

RUN apt update
COPY . /workspace

RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry export -f requirements.txt --output requirements.txt
COPY pyproject.toml poetry.lock /workspace/

RUN pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry export -f requirements.txt --output requirements.txt --without-hashes \
&& pip uninstall -y poetry

RUN pip install -r requirements.txt

COPY . /workspace

RUN python3 -m src.ainu_lm_trainer.app.main cache

ENTRYPOINT ["python3", "-m", "src.ainu_lm_trainer.app.main"]

0 comments on commit aa2c288

Please sign in to comment.