forked from dice-group/LIMES
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (31 loc) · 916 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (31 loc) · 916 Bytes
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
########
## BUILD
# build first using maven
FROM maven:3.3.9-jdk-8 as builder
# set workdir
WORKDIR /limes
# copy files
ADD . /limes
WORKDIR /limes/limes-core
RUN mvn clean package shade:shade -Dmaven.test.skip=true
# do some magic to get the right jar file to copy
RUN mvn com.smartcodeltd:release-candidate-maven-plugin:LATEST:version \
-DoutputTemplate="PROJECT_VERSION={{ version }}" \
-DoutputUri="file://\${project.basedir}/__version" && \
cat __version | sed -e /^$/d -e /^#/d -e 's/^/export /' > _version && \
. ./_version && \
cp -p ./target/limes-core-${PROJECT_VERSION}.jar /limes/limes.jar
##########
## RELEASE
# then run in a lighter jdk base
FROM openjdk:8-jdk
# set workdir
WORKDIR /limes
# copy jar from build step
COPY --from=builder /limes/limes.jar limes.jar
# set default java flags
ENV JAVA_OPTS="-Xmx2G"
# expose port
EXPOSE 8080
# assign start command
CMD ["java", "-jar", "limes.jar", "-s"]