mirror of
https://github.com/DerDavidBohl/dirigent-spring.git
synced 2026-01-08 00:39:35 -06:00
29 lines
731 B
Docker
29 lines
731 B
Docker
|
|
FROM node:alpine AS frontend-build
|
|
WORKDIR /app
|
|
COPY frontend .
|
|
RUN rm -rf package-lock.json
|
|
RUN npm cache clean --force
|
|
RUN npm install
|
|
RUN npm run build
|
|
|
|
# Use Maven image to build the application
|
|
FROM maven:3.9.11-eclipse-temurin-21-alpine AS backend-build
|
|
WORKDIR /app
|
|
COPY backend/pom.xml .
|
|
COPY backend/src ./src
|
|
COPY --from=frontend-build /app/dist/browser ./src/main/resources/static
|
|
RUN mvn clean package -DskipTests
|
|
|
|
# Use OpenJDK image to run the application
|
|
FROM eclipse-temurin:21-alpine
|
|
|
|
# Install Docker and git
|
|
RUN apk add docker docker-compose git
|
|
|
|
# Finish
|
|
WORKDIR /app
|
|
COPY --from=backend-build /app/target/*.jar app.jar
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=production"]
|