-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile-cache
24 lines (20 loc) · 991 Bytes
/
Dockerfile-cache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM maven:3-openjdk-17 AS cache
RUN mkdir -p /build/src /build/user-console /build/dev-console /build/admin-console
COPY ./pom.xml /build/pom.xml
COPY ./user-console/package.json /build/user-console
COPY ./user-console/yarn.lock /build/user-console
COPY ./dev-console/package.json /build/dev-console
COPY ./dev-console/yarn.lock /build/dev-console
COPY ./admin-console/package.json /build/admin-console
COPY ./admin-console/yarn.lock /build/admin-console
WORKDIR /build
RUN mvn dependency:go-offline
RUN mvn clean generate-resources
FROM scratch
LABEL org.opencontainers.image.source=https://github.com/scc-digitalhub/digitalhub-core
WORKDIR /cache
COPY --from=cache /root/.m2 /cache/.m2
COPY --from=cache /build/target /cache/target
COPY --from=cache /build/user-console/node_modules /cache/user-console/node_modules
COPY --from=cache /build/dev-console/node_modules /cache/dev-console/node_modules
COPY --from=cache /build/admin-console/node_modules /cache/admin-console/node_modules