forked from jenkinsci/custom-distribution-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.infra
39 lines (27 loc) · 907 Bytes
/
Dockerfile.infra
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
FROM maven:3.6.0-jdk-8-alpine AS MAVEN_BUILD
COPY pom.xml /build/
COPY src/ /build/src/
COPY config/ /build/config/
WORKDIR /build/
RUN mvn clean package spring-boot:repackage
RUN mv target/custom-distribution-service-*.jar custom-distribution-service.jar
FROM node:14.7.0-alpine AS NODE_BUILD
WORKDIR /build
COPY frontend/package* /build/
RUN npm install
COPY frontend/ /build/
ENV REACT_APP_API_URL /
RUN npm run build
FROM maven:3.6.0-jdk-8-alpine
LABEL maintainer="[email protected]"
RUN \
addgroup -g 1000 -S appuser && \
adduser -u 1000 -S appuser -G appuser && \
mkdir /app && \
chown -R appuser:appuser /app
USER appuser
WORKDIR /app
COPY --chown=appuser --from=MAVEN_BUILD /build/custom-distribution-service.jar /app/
COPY --chown=appuser --from=NODE_BUILD /build/build/ /app/public/
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app/custom-distribution-service.jar"]