-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (24 loc) · 809 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (24 loc) · 809 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
# Build the frontend
FROM node:lts-alpine AS frontend-build
WORKDIR /workspace/frontend
COPY frontend/package.json .
COPY frontend/package-lock.json .
ENV NODE_ENV=development
RUN npm install
COPY frontend .
RUN npm run type-check && npm run build-only
# Build the API
FROM eclipse-temurin:21-jdk-alpine AS api-build
WORKDIR /workspace/api
COPY api/mvnw .
COPY api/.mvn .mvn
COPY api/pom.xml .
COPY api/src src
# Include the frontend in the jar, so we can serve it without an extra server
COPY --from=frontend-build /workspace/frontend/dist src/main/resources/static
RUN chmod +x mvnw && ./mvnw install -DskipTests
# Package everything together in a small image
FROM eclipse-temurin:21-jdk-alpine
VOLUME /tmp
COPY --from=api-build /workspace/api/target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]