Skip to content

Commit

Permalink
Simplify docker configuration of MorphoDiTa-based Annotace.
Browse files Browse the repository at this point in the history
Use volumes to pass taggers to Annotace instead of baking them into the image.
  • Loading branch information
ledsoft committed Apr 11, 2024
1 parent 8ad0455 commit c8ddbe4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM gradle:8.0.2-jdk11-alpine as build
RUN mkdir annotace
WORKDIR /annotace
COPY . .
RUN gradle bootJar -Pcore,lemmatizer-spark,keywordextractor-ker
RUN gradle bootJar -x test

FROM eclipse-temurin:11-jdk-alpine as runtime
COPY --from=build /annotace/core/build/libs/*.jar /
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile-morphodita
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
ARG MORPHODITA_TAGGERS
ARG MORPHODITA_ZIP
ARG MORPHODITA_ZIP_SO

########################################################################################################################

FROM alpine as unzip
ARG MORPHODITA_TAGGERS
ARG MORPHODITA_ZIP
RUN mkdir taggers
RUN mkdir morphodita
COPY $MORPHODITA_TAGGERS /taggers
COPY $MORPHODITA_ZIP /morphodita
WORKDIR /morphodita
RUN unzip *.zip
Expand All @@ -28,7 +24,6 @@ RUN apk add --update --no-cache libc6-compat
RUN cp /lib64/ld-linux-x86-64.so.2 /lib/
COPY --from=buildMaven /annotace/core/build/libs/annotace-*.jar /
RUN mv *.jar annotace.jar
COPY --from=unzip /taggers .
COPY --from=unzip /morphodita/$MORPHODITA_ZIP_SO /lib

EXPOSE 8080
Expand Down
9 changes: 4 additions & 5 deletions docker-compose-morphodita.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.9'
services:
annotace:
container_name: annotace
Expand All @@ -11,12 +10,12 @@ services:
MORPHODITA_ZIP: lib/morphodita-1.9.2-bin.zip
# path to the MorphoDiTa shared library within the $MORPHODITA_ZIP
MORPHODITA_ZIP_SO: morphodita-1.9.2-bin/bin-linux64/java/libmorphodita_java.so
# path to a directory containing taggers to use, from https://lindat.mff.cuni.cz/repository/xmlui/handle/11234/1-1836
MORPHODITA_TAGGERS: lib/tagger-morfflex2
environment:
# List of taggers mapped to individual supported languages (tagger names should correspond to files in $MORPHODITA_TAGGERS)
ANNOTACE_MORPHODITA_TAGGERS_CS: czech-morfflex2.0-pdtc1.0-220710.tagger
# List of taggers mapped to individual supported languages (tagger names should correspond to files in the taggers volume)
ANNOTACE_MORPHODITA_TAGGERS_CS: taggers/czech-morfflex2.0-pdtc1.0-220710.tagger
ANNOTACE_LEMMATIZER: morphodita-jni
volumes:
- ./lib/taggers:/taggers
ports:
- 8888:8080
network_mode: host
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.9'
services:
annotace:
container_name: annotace
Expand Down

0 comments on commit c8ddbe4

Please sign in to comment.