forked from CDCgov/fdns-ms-msft-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (32 loc) · 1.13 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
# build stage
FROM cdcgov/maven:fdns as builder
COPY . /usr/src/app
RUN mvn clean package
# run stage
FROM java:8-jre
ARG MSFT_UTILS_FLUENTD_HOST
ARG MSFT_UTILS_FLUENTD_PORT
ARG MSFT_UTILS_PORT
ARG MSFT_UTILS_PROXY_HOSTNAME
ARG OAUTH2_ACCESS_TOKEN_URI
ARG OAUTH2_PROTECTED_URIS
ARG OAUTH2_CLIENT_ID
ARG OAUTH2_CLIENT_SECRET
ARG SSL_VERIFYING_DISABLE
ENV MSFT_UTILS_FLUENTD_HOST ${MSFT_UTILS_FLUENTD_HOST}
ENV MSFT_UTILS_FLUENTD_PORT ${MSFT_UTILS_FLUENTD_PORT}
ENV MSFT_UTILS_PORT ${MSFT_UTILS_PORT}
ENV MSFT_UTILS_PROXY_HOSTNAME ${MSFT_UTILS_PROXY_HOSTNAME}
ENV OAUTH2_ACCESS_TOKEN_URI ${OAUTH2_ACCESS_TOKEN_URI}
ENV OAUTH2_PROTECTED_URIS ${OAUTH2_PROTECTED_URIS}
ENV OAUTH2_CLIENT_ID ${OAUTH2_CLIENT_ID}
ENV OAUTH2_CLIENT_SECRET ${OAUTH2_CLIENT_SECRET}
ENV SSL_VERIFYING_DISABLE ${SSL_VERIFYING_DISABLE}
COPY --from=builder /usr/src/app/target/fdns-ms-msft-utils-*.jar /app.jar
# pull latest
RUN apt-get update && apt-get -y upgrade
# don't run as root user
RUN chown 1001:0 /app.jar
RUN chmod g+rwx /app.jar
USER 1001
ENTRYPOINT java -Dserver.tomcat.protocol-header=x-forwarded-proto -Dserver.tomcat.remote-ip-header=x-forwarded-for -jar /app.jar