Skip to content
Snippets Groups Projects

add Dockerfile for ci build and run

Closed Martin Jürgens requested to merge (removed):main into main
1 file
+ 14
0
Compare changes
  • Side-by-side
  • Inline
+ 14
0
 
FROM maven:3-eclipse-temurin-17-alpine AS build
 
 
# tests (in this case: including build) have to run in a non-privileged context: https://github.com/zonkyio/embedded-database-spring-test#running-tests-in-docker-does-not-work
 
RUN addgroup -S -g 1000 build-user
 
RUN adduser -D -S -G build-user -u 1000 -s /bin/ash build-user
 
USER build-user
 
 
COPY --chown=build-user . /opt/
 
RUN mvn -ntp -f /opt/pom.xml clean package
 
 
# based on https://gitlab.eclipse.org/eclipse/xfsc/authenticationauthorization/-/blob/main/service/Dockerfile?ref_type=heads
 
FROM eclipse-temurin:17-jre-alpine
 
COPY --from=build /opt/service/target/auth-service-1.1.0-SNAPSHOT.jar auth-service-1.1.0-SNAPSHOT.jar
 
ENTRYPOINT ["java", "-jar", "/auth-service-1.1.0-SNAPSHOT.jar"]
Loading