-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (30 loc) · 948 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM openjdk:19-jdk-alpine as builder
RUN apk add --update nodejs npm
WORKDIR /opt/build/front
COPY front/package.json ./
COPY front/package-lock.json ./
RUN npm ci
COPY front/src src
COPY front/index.html ./
COPY front/postcss.config.cjs ./
COPY front/tailwind.config.cjs ./
COPY front/tsconfig.json ./
COPY front/tsconfig.node.json ./
COPY front/vite.config.ts ./
# RUN npm run build -- --outDir ../back/src/main/resources/static/
ARG API_URL
ENV VITE_API_URL=$API_URL
RUN npm run build
WORKDIR /opt/build/back
COPY back/pom.xml ./
COPY back/.mvn .mvn
COPY back/mvnw ./
RUN ./mvnw clean verify --fail-never
COPY back/src src
RUN cp -r /opt/build/front/dist/. /opt/build/back/src/main/resources/static/
RUN ./mvnw clean package
FROM openjdk:19-jdk-alpine AS runner
WORKDIR /opt/app
COPY --from=builder /opt/build/back/target/hahn-challenge-0.0.1-SNAPSHOT.jar ./hahn-challenge.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "hahn-challenge.jar"]