-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1.01 KB
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
# --- Start build/compile
FROM openjdk:8-jdk-alpine as BUILD-STAGE
ARG TLRL_SPRING_PROFILES=${TLRL_SPRING_PROFILES}
ARG TLRL_TARGET_DB=${TLRL_TARGET_DB}
ARG TLRL_SKIP_TESTS=${TLRL_SKIP_TESTS}
# Setup
RUN apk add --update nodejs npm
# Copy over source
ADD . /tlrl
WORKDIR /tlrl
RUN \
# Build frontend and copy over to backend
npm install --prefix frontend \
&& npm run build --prefix frontend \
# Build the backend
&& SPRING_PROFILES_ACTIVE=${TLRL_SPRING_PROFILES},${TLRL_TARGET_DB} \
./mvnw -f backend/pom.xml package -Dmaven.test.skip=${TLRL_SKIP_TESTS} -Ddb=${TLRL_TARGET_DB} \
&& mv backend/target/tlrl-*-SNAPSHOT.jar backend/tlrl.jar \
# Clean up
&& rm -rf frontend/node_modules \
&& rm -rf backend/target
# --- Start final image
FROM openjdk:8-jre-alpine
LABEL maintainer="ikumen@gnoht.com"
RUN mkdir app
COPY --from=BUILD-STAGE /tlrl/backend/tlrl.jar /app/tlrl.jar
EXPOSE 8080
ENTRYPOINT [ "java", "-Dspring.profiles.active=${TLRL_SPRING_PROFILES},${TLRL_TARGET_DB}", "-jar", "/app/tlrl.jar" ]