diff --git a/Dockerfile b/Dockerfile index 7f035e0..f327737 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,20 @@ FROM node:18-alpine AS frontend-builder -WORKDIR /app -COPY ./app/package.json ./app/package-lock.json ./ +WORKDIR /frontend +COPY ./frontend/package.json ./frontend/package-lock.json ./ RUN npm install -COPY ./app . +COPY ./frontend . RUN npm run build FROM openjdk:17-slim AS backend-builder -WORKDIR /app +WORKDIR / COPY ./pom.xml ./ COPY ./src ./src RUN apt-get update && apt-get install -y maven && mvn dependency:go-offline -B -COPY --from=frontend-builder /app/build ./src/main/resources/static/ +COPY --from=frontend-builder /frontend/public/dist ./src/main/resources/static/ RUN mvn clean package -DskipTests FROM openjdk:17-slim -WORKDIR /app -COPY --from=backend-builder /app/target/example-extension-java-vue-0.0.1-SNAPSHOT.jar ./example-extension-java-vue-0.0.1-SNAPSHOT.jar +WORKDIR / +COPY --from=backend-builder target/example-extension-java-vue-0.0.1-SNAPSHOT.jar ./example-extension-java-vue-0.0.1-SNAPSHOT.jar COPY src/main/resources/application-prod.yml ./application-prod.yml ENV SPRING_PROFILES_ACTIVE=prod EXPOSE 8080 -CMD ["java", "-jar", "example-extension-java-vue-0.0.1-SNAPSHOT.jar"] +CMD ["java", "-jar", "example-extension-java-react-0.0.1-SNAPSHOT.jar"] diff --git a/pom.xml b/pom.xml index ad12b51..ab00fd7 100644 --- a/pom.xml +++ b/pom.xml @@ -123,10 +123,10 @@ copy-resources - target/classes/static + src/main/resources/static - app/dist + frontend/public/dist true