This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
63 lines (55 loc) · 1.55 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# build stage
FROM cdcgov/maven:fdns as builder
COPY . /usr/src/app
RUN mvn clean test
RUN ./generate-jar.sh
# run stage
FROM openjdk:8-jre-alpine
ARG PROFILE_NAME
ARG GROUP_NAME
ARG INCOMING_TOPIC_NAME
ARG OUTGOING_TOPIC_NAME
ARG ERROR_TOPIC_NAME
ARG KAFKA_BROKERS
ARG SCHEMA_REGISTRY_URL
ARG OBJECT_URL
ARG STORAGE_URL
ARG INDEXING_URL
ARG COMBINER_URL
ARG MICROSOFT_UTILS_URL
ARG OBJECT_BATCH_SIZE
ARG INDEXING_BATCH_SIZE
ARG OAUTH_URL
ARG OAUTH_ENABLED
ARG OAUTH_CLIENTID
ARG OAUTH_CLIENTSECRET
ARG OAUTH_SCOPES
ARG SSL_VERIFYING_DISABLE
ENV PROFILE_NAME ${PROFILE_NAME}
ENV GROUP_NAME ${GROUP_NAME}
ENV INCOMING_TOPIC_NAME ${INCOMING_TOPIC_NAME}
ENV OUTGOING_TOPIC_NAME ${OUTGOING_TOPIC_NAME}
ENV ERROR_TOPIC_NAME ${ERROR_TOPIC_NAME}
ENV KAFKA_BROKERS ${KAFKA_BROKERS}
ENV SCHEMA_REGISTRY_URL ${SCHEMA_REGISTRY_URL}
ENV OBJECT_URL ${OBJECT_URL}
ENV STORAGE_URL ${STORAGE_URL}
ENV INDEXING_URL ${INDEXING_URL}
ENV COMBINER_URL ${COMBINER_URL}
ENV MICROSOFT_UTILS_URL ${MICROSOFT_UTILS_URL}
ENV OBJECT_BATCH_SIZE ${OBJECT_BATCH_SIZE}
ENV INDEXING_BATCH_SIZE ${INDEXING_BATCH_SIZE}
ENV OAUTH_URL ${OAUTH_URL}
ENV OAUTH_ENABLED ${OAUTH_ENABLED}
ENV OAUTH_CLIENTID ${OAUTH_CLIENTID}
ENV OAUTH_CLIENTSECRET ${OAUTH_CLIENTSECRET}
ENV OAUTH_SCOPES ${OAUTH_SCOPES}
ENV SSL_VERIFYING_DISABLE ${SSL_VERIFYING_DISABLE}
COPY --from=builder /usr/src/app/target/fdns-ms-reporting-kafka-*-jar-with-dependencies.jar /app.jar
# pull latest
RUN apk update && apk upgrade --no-cache
# don't run as root user
RUN chown 1001:0 /app.jar
RUN chmod g+rwx /app.jar
USER 1001
ENTRYPOINT java -jar /app.jar