Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using program in docker container #2

Open
vt0022 opened this issue Jun 9, 2024 · 0 comments
Open

Using program in docker container #2

vt0022 opened this issue Jun 9, 2024 · 0 comments

Comments

@vt0022
Copy link

vt0022 commented Jun 9, 2024

I am trying to integrate this great program into my Spring Boot project. The app runs smoothly on my local device, but when I deploy my app to a Docker container, the tag extractor function seems to be not working. It only logs "Loading Word Segmentation Model," and I cannot receive any keywords.

I've put the models and jar library as the same structures in my project, and it still didn't work. I've tried to install the library in different ways, but with no results.

My Dockerfile:

FROM maven:3.8.3-openjdk-17 as BUILD

WORKDIR /digital-library

COPY src/ ./src
COPY pom.xml ./
COPY models/ ./models
COPY jdf.jar ./
COPY VnCoreNLP-1.2.jar ./

RUN mvn -f /digital-library/pom.xml -B -DskipTests clean install

FROM openjdk:17-jdk

WORKDIR /app

ARG JAR_FILE_NAME=digital-library-0.0.1-SNAPSHOT.jar

COPY --from=BUILD /digital-library/target/${JAR_FILE_NAME} ./app.jar
COPY --from=BUILD /digital-library/src/main/resources ./src/main/resources
COPY --from=BUILD /digital-library/jdf.jar ./
COPY --from=BUILD /digital-library/VnCoreNLP-1.2.jar ./

EXPOSE 8080
CMD ["sh", "-c", "java -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} -jar /app/app.jar"]

My dependency declaration:

        <dependency>
            <groupId>jdf</groupId>
            <artifactId>jdf</artifactId>
            <version>1.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/jdf.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>vnpipeline</groupId>
            <artifactId>vnpipeline</artifactId>
            <version>1.2.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/VnCoreNLP-1.2.jar</systemPath>
        </dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant