-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (24 loc) · 891 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
37
38
39
40
FROM gradle:8.5-jdk17 AS booking-service-build
COPY booking-service /home/gradle/booking-service
RUN <<EOT bash
cd /home/gradle/booking-service
gradle clean build
EOT
FROM gradle:8.5-jdk17 AS payment-service-build
COPY payment-service /home/gradle/payment-service
RUN <<EOT bash
cd /home/gradle/payment-service
gradle clean build
EOT
FROM openjdk:17.0.1-jdk-slim AS booking-service-app
RUN adduser --system --group app-user
COPY --from=booking-service-build --chown=app-user:app-user /home/gradle/booking-service/build/libs/*-SNAPSHOT.jar app.jar
EXPOSE 8080
USER app-user
CMD ["java", "-jar", "app.jar"]
FROM openjdk:17.0.1-jdk-slim AS payment-service-app
RUN adduser --system --group app-user
COPY --from=payment-service-build --chown=app-user:app-user /home/gradle/payment-service/build/libs/*-SNAPSHOT.jar app.jar
EXPOSE 8081
USER app-user
CMD ["java", "-jar", "app.jar"]