Skip to content

Commit

Permalink
compact Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Apr 5, 2024
1 parent 3c9f5b4 commit 4a24f5a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ COPY ["gradlew*", "build.gradle", "settings.gradle", "gradle.properties", "./gro
COPY .git/ ./grobid-superconductors_source/.git/

# Preparing models
RUN rm -rf /opt/grobid-source/grobid-home/models/*
WORKDIR /opt/grobid-source/grobid-superconductors_source
RUN git remote prune origin && git repack && git prune-packed && git reflog expire --expire=1.day.ago && git gc --aggressive \
&& ./gradlew downloadTransformers --no-daemon --info --stacktrace \
&& rm -f /opt/grobid-source/grobid-home/models/*.zip \
&& rm -rf /opt/grobid-source/grobid-home/models/*.-with_ELMo \
&& rm -rf /opt/grobid-source/grobid-home/models/entityLinker* \
&& ./gradlew clean assemble -x shadowJar --no-daemon --stacktrace --info \
&& unzip -o build/distributions/grobid-superconductors-*.zip -d ../grobid-superconductors_distribution \
&& mv ../grobid-superconductors_distribution/grobid-superconductors-* ../grobid-superconductors \
&& rm -rf ../grobid-superconductors_distribution \
&& rm -rf .git \
&& rm -rf /opt/grobid-source/grobid-home/models/*.-with_ELMo \
&& rm -rf /opt/grobid-source/grobid-home/models/entityLinker* \
&& rm -rf /opt/grobid-source/grobid-home/models/superconductors-mattpuscibert-BERT_CRF
&& rm -rf /opt/grobid-source/grobid-superconductors_source/.git \


# Preparing distribution
WORKDIR /opt/grobid-source/grobid-superconductors_source
Expand Down

0 comments on commit 4a24f5a

Please sign in to comment.