-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (21 loc) · 991 Bytes
/
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
FROM maven:3-jdk-8 as builder
COPY . /tmp/pattern-atlas-auth
WORKDIR /tmp/pattern-atlas-auth
RUN mvn package -DskipTests
FROM openjdk:8
ARG DOCKERIZE_VERSION=v0.6.1
ENV AUTH_PORT 8081
ENV JDBC_DATABASE_URL localhost
ENV JDBC_DATABASE_USERNAME postgres
ENV JDBC_DATABASE_PASSWORD postgres
ENV JDBC_DATABASE_NAME postgres
ENV JDBC_DATABASE_PORT 5060
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
EXPOSE ${AUTH_PORT}
COPY --from=builder /tmp/pattern-atlas-auth/target/auth-0.0.1-SNAPSHOT.jar /var/www/java/auth.jar
ADD .docker/application.properties.tpl /var/www/java/application.properties.tpl
CMD dockerize -template /var/www/java/application.properties.tpl:/var/www/java/application.properties \
&& cd /var/www/java/ \
&& java -jar auth.jar