diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..30cf3d8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1.7-labs +FROM node:22 AS fe-build + +RUN mkdir /mnt/workspace +WORKDIR /mnt/workspace +RUN cd /mnt/workspace + +COPY ./frontend /mnt/workspace + +RUN npm install --global pnpm \ + && pnpm install \ + && pnpm run build + +FROM gradle AS be-build + +RUN mkdir /mnt/workspace +WORKDIR /mnt/workspace +RUN cd /mnt/workspace + +COPY --exclude=./frontend . /mnt/workspace + +RUN ./gradlew build -x test + +FROM eclipse-temurin:21-jre-alpine + +ENV USE_SYSTEM_CA_CERTS=1 + +RUN mkdir /opt/home-cert-assistant +WORKDIR /opt/home-cert-assistant + +COPY --from=fe-build /mnt/workspace/dist /opt/home-cert-assistant/frontend +COPY --from=be-build /mnt/workspace/build/home-cert-assistant-0.0.1-SNAPSHOT.jar /opt/home-cert-assistant/ + +CMD ["java", "-jar", "/opt/home-cert-assistant/home-cert-assistant-0.0.1-SNAPSHOT.jar"] \ No newline at end of file