Skip to content

Commit

Permalink
Build app in Dockerfile for BEIS PaaS
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbarnett91 committed Nov 16, 2023
1 parent a6b21df commit bcfa454
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Build steps
FROM public.ecr.aws/docker/library/node:10 as build-frontend
WORKDIR /build
COPY . .
RUN npm install && npx gulp buildAll

FROM public.ecr.aws/docker/library/eclipse-temurin:17 as build-backend
COPY --from=build-frontend /build .
RUN chmod +x gradlew && ./gradlew test bootJar

# Runtime image
FROM public.ecr.aws/docker/library/eclipse-temurin:17-alpine
COPY ./build/libs/energy-label-service-SNAPSHOT.jar app.jar
COPY --from=build-backend ./build/libs/energy-label-service-SNAPSHOT.jar app.jar

RUN apk update && apk upgrade && rm -rf /var/cache/apk/*

Expand All @@ -11,4 +22,4 @@ RUN apk add --update tzdata \
RUN adduser -S elg
USER elg

ENTRYPOINT exec java $JAVA_OPTS -jar app.jar
ENTRYPOINT exec java $JAVA_OPTS -jar app.jar

0 comments on commit bcfa454

Please sign in to comment.