-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.server
37 lines (27 loc) · 1.04 KB
/
Dockerfile.server
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
FROM openjdk:11.0.3-jdk as builder
RUN apt update -y && apt upgrade -y && \
apt install -y maven
ENV JAR_FILE /score-server.jar
# Build song-server jar
WORKDIR /srv
COPY . /srv
RUN mvn package -DskipTests \
&& cd score-server/target \
&& mv score-server-*-dist.tar.gz score-server.tar.gz \
&& tar zxvf score-server.tar.gz -C /tmp \
&& mv -f /tmp/score-server-* /tmp/score-dist \
&& cp -f /tmp/score-dist/lib/score-server.jar $JAR_FILE
###############################################################################################################
FROM openjdk:11.0.3-jre
# Paths
ENV SCORE_HOME /score-server
ENV SCORE_LOGS $SCORE_HOME/logs
ENV JAR_FILE /score-server.jar
COPY --from=builder $JAR_FILE $JAR_FILE
WORKDIR $SCORE_HOME
CMD mkdir -p $SCORE_HOME $SCORE_LOGS \
&& java -Dlog.path=$SCORE_LOGS \
-jar $JAR_FILE \
--spring.config.location=classpath:/application.yml \
--spring.profiles.active=s3,prod,secure
#&& FOR_100_YEARS=$((100*365*24*60*60));while true;do sleep $FOR_100_YEARS;done