-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
46 lines (30 loc) · 1.34 KB
/
Dockerfile
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
40
41
42
43
44
45
46
# syntax=docker/dockerfile:experimental
FROM maven:3-jdk-8-alpine as build
MAINTAINER apereo.org
# Set Timezone to make sure SLF4J logs the correct timestamp
RUN apk --no-cache add \
tzdata \
&& echo "${TIME_ZONE}" > /etc/timezone \
&& ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime
# Create a main directory and copy the maven pom file
RUN mkdir -p /build
COPY pom.xml /build/pom.xml
WORKDIR /build
# Download Maven dependencies
RUN mvn -B dependency:resolve dependency:resolve-plugins
COPY src /build/src
EXPOSE $SPRING_PORT
# Build application
RUN mvn clean package
ENV APP_HOME /app
# Create base app folder
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
RUN mkdir config log
VOLUME $APP_HOME/log
VOLUME $APP_HOME/config
# Expose volumes where application.log and application.yml will be generated/replaced
VOLUME ["/tmp/openlrw", "/app/log"]
WORKDIR /build
RUN cp /build/target/*.jar ${APP_HOME}/openlrw.jar
ENTRYPOINT ["java","-Dspring.data.mongodb.uri=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}/${MONGO_DB}","-Djava.security.egd=file:/dev/./urandom","-Dmatthews.security.jwt.tokenIssuer=http://localhost", "-Dmatthews.security.jwt.tokenSigningKey=${TOKEN_SIGNING_KEY}","-Djava.io.tmpdir=/tmp/openlrw","-Dmatthews.security.jwt.tokenExpirationTime=360","-Dmatthews.security.jwt.refreshTokenExpTime=240","-jar","/app/openlrw.jar"]