-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
151 lines (126 loc) · 6.39 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
FROM bellsoft/liberica-openjre-alpine:17 AS app-base
WORKDIR /app
VOLUME /tmp
FROM bellsoft/liberica-openjdk-alpine:17 AS build-base
WORKDIR /app
COPY . /app
### Restaurant Service ###
FROM build-base AS build-restaurant-service
ARG TARGET_PROJECT=ftgo-restaurant-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS restaurant-service
ARG DEPENDENCY=/app/ftgo-restaurant-service/build/dependency
COPY --from=build-restaurant-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-restaurant-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-restaurant-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.restaurant_service.RestaurantServiceMain"]
### Consumer Service ###
FROM build-base AS build-consumer-service
ARG TARGET_PROJECT=ftgo-consumer-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS consumer-service
ARG DEPENDENCY=/app/ftgo-consumer-service/build/dependency
COPY --from=build-consumer-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-consumer-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-consumer-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.consumer_service.ConsumerServiceApplicationKt"]
### Kitchen Service ###
FROM build-base AS build-kitchen-service
ARG TARGET_PROJECT=ftgo-kitchen-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS kitchen-service
ARG DEPENDENCY=/app/ftgo-kitchen-service/build/dependency
COPY --from=build-kitchen-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-kitchen-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-kitchen-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.kitchen_service.KitchenServiceApplication"]
### Order Service ###
FROM build-base AS build-order-service
ARG TARGET_PROJECT=ftgo-order-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS order-service
ARG DEPENDENCY=/app/ftgo-order-service/build/dependency
COPY --from=build-order-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-order-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-order-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.order_service.OrderServiceApplicationKt"]
### Accounting Service ###
FROM build-base AS build-accounting-service
ARG TARGET_PROJECT=ftgo-accounting-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS accounting-service
ARG DEPENDENCY=/app/ftgo-accounting-service/build/dependency
COPY --from=build-accounting-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-accounting-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-accounting-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.accounting_service.AccountingServiceApplicationKt"]
### Order History Service ###
FROM build-base AS build-order-history-service
ARG TARGET_PROJECT=ftgo-order-history-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS order-history-service
ARG DEPENDENCY=/app/ftgo-order-history-service/build/dependency
COPY --from=build-order-history-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-order-history-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-order-history-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.order_history_service.OrderHistoryServiceMainKt"]
### Delivery Service ###
FROM build-base AS build-delivery-service
ARG TARGET_PROJECT=ftgo-delivery-service
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
clean build \
-x test \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS delivery-service
ARG DEPENDENCY=/app/ftgo-delivery-service/build/dependency
COPY --from=build-delivery-service ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-delivery-service ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-delivery-service ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.delivery_service.DeliveryServiceApplicationKt"]
### API Gateway ###
FROM build-base AS build-api-gateway
ARG TARGET_PROJECT=ftgo-api-gateway
ENV TARGET_PROJECT=${TARGET_PROJECT}
RUN --mount=type=cache,target=/root/.gradle ./gradlew \
-x test \
clean build \
-p ${TARGET_PROJECT}
RUN mkdir -p ${TARGET_PROJECT}/build/dependency && (cd ${TARGET_PROJECT}/build/dependency; jar -xf ../libs/*-SNAPSHOT.jar)
FROM app-base AS api-gateway
ARG DEPENDENCY=/app/ftgo-api-gateway/build/dependency
COPY --from=build-api-gateway ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build-api-gateway ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build-api-gateway ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp",".:./lib/*","me.jangjunha.ftgo.apigateway.APIGatewayApplicationKt"]