Skip to content

Commit

Permalink
Build gui-client in Docker
Browse files Browse the repository at this point in the history
See #425, #556.
  • Loading branch information
denkv committed Oct 11, 2023
1 parent 536e7b4 commit 2726095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ build: build-java build-dev-images
build-java: install-parent-pom build-controller build-storage build-analysis build-gui

build-gui:
cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm install; true' && npm run build-prod
# see hobbit-gui/gui-serverbackend/Dockerfile

build-controller:
Expand Down
10 changes: 9 additions & 1 deletion hobbit-gui/gui-serverbackend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# https://nodejs.org/en/docs/guides/nodejs-docker-webapp
FROM node:16 AS build-client
WORKDIR /usr/src/hobbit-platform
COPY hobbit-gui/gui-client/package*.json ./hobbit-gui/gui-client/
RUN npm --prefix hobbit-gui/gui-client ci --omit=dev
COPY hobbit-gui/gui-client ./hobbit-gui/gui-client
RUN npm --prefix hobbit-gui/gui-client run build-prod

FROM maven:3-eclipse-temurin-11 AS build
WORKDIR /usr/src/hobbit-platform
COPY parent-pom/pom.xml ./parent-pom/
COPY hobbit-gui/gui-serverbackend/pom.xml ./hobbit-gui/gui-serverbackend/
RUN mvn --file ./hobbit-gui/gui-serverbackend/ dependency:go-offline
COPY hobbit-gui/gui-serverbackend/src ./hobbit-gui/gui-serverbackend/src
RUN mvn --file ./hobbit-gui/gui-serverbackend/ test
COPY hobbit-gui/gui-client/dist ./hobbit-gui/gui-client/dist
COPY --from=build-client /usr/src/hobbit-platform/hobbit-gui/gui-client/dist ./hobbit-gui/gui-client/dist
RUN mvn --file ./hobbit-gui/gui-serverbackend/ package

FROM jetty:9.3-jre8
Expand Down

0 comments on commit 2726095

Please sign in to comment.