-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (28 loc) · 940 Bytes
/
Dockerfile
File metadata and controls
31 lines (28 loc) · 940 Bytes
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
############################
# Frontend build stage
############################
FROM node:18 AS frontend
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
############################
# Java build stage
############################
FROM maven:3.9-eclipse-temurin-23 AS build
WORKDIR /app
COPY backend/pom.xml backend/pom.xml
RUN --mount=type=cache,target=/root/.m2 mvn -q -DskipTests -f backend/pom.xml dependency:go-offline
COPY backend/src/ backend/src/
RUN --mount=type=cache,target=/root/.m2 mvn -q -DskipTests -f backend/pom.xml package
############################
# Runtime image
############################
FROM eclipse-temurin:23-jre
WORKDIR /app
# Copy the Spring Boot fat jar (exclude the .original)
COPY --from=build /app/backend/target/*-SNAPSHOT.jar /app/app.jar
COPY --from=frontend /app/frontend/dist /app/frontend/dist
EXPOSE 3000
CMD ["java", "-jar", "/app/app.jar"]