-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
62 lines (47 loc) · 2.47 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
# Build Args
ARG BUILD_DATE_TIME
ARG VERSION
ARG BUILD_NUMBER
ARG BUILD_TOOL
FROM ghcr.io/department-of-veterans-affairs/health-apis-docker-octopus/lighthouse-node-application-base:v2-node16 as npminstall
WORKDIR /home/lhuser
RUN git config --global url."https://".insteadOf git://
COPY --chown=lhuser:lhuser package.json package.json
COPY --chown=lhuser:lhuser package-lock.json package-lock.json
RUN npm install
FROM npminstall as tscbuild
COPY --chown=lhuser:lhuser bin/ bin/
COPY --chown=lhuser:lhuser src/ src/
COPY --chown=lhuser:lhuser public/ public/
COPY --chown=lhuser:lhuser styles/ styles/
COPY --chown=lhuser:lhuser views/ views/
COPY --chown=lhuser:lhuser tsconfig.json ./
RUN ./node_modules/.bin/tsc
FROM ghcr.io/department-of-veterans-affairs/health-apis-docker-octopus/lighthouse-node-application-base:v2-node16 as deploy
WORKDIR /home/lhuser
COPY --chown=lhuser:lhuser *.pem ./
COPY --chown=lhuser:lhuser *.key ./
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/bin/ ./bin/
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/public/ ./public/
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/styles/ ./styles/
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/views/ ./views/
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/node_modules/ ./node_modules/
COPY --from=tscbuild --chown=lhuser:lhuser /home/lhuser/build/ ./build/
EXPOSE 7000 7000
HEALTHCHECK --interval=1m --timeout=4s --start-period=30s \
CMD curl -f http://localhost:7000/samlproxy/idp/metadata || exit 1
ENTRYPOINT ["/usr/local/bin/tini", "--"]
CMD ["node", "build/app.js", "--config", "/etc/saml-proxy/config.json"]
# Static Labels
LABEL org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.url="https://github.com/department-of-veterans-affairs/lighthouse-saml-proxy/tree/master/Dockerfile" \
org.opencontainers.image.documentation="https://github.com/department-of-veterans-affairs/lighthouse-saml-proxy/tree/master/README.md" \
org.opencontainers.image.vendor="lighthouse" \
org.opencontainers.image.title="saml-proxy" \
org.opencontainers.image.source="https://github.com/department-of-veterans-affairs/lighthouse-saml-proxy/tree/master" \
org.opencontainers.image.description="SAML Proxy for Lighthouse APIs"
# Dynamic Labels
LABEL org.opencontainers.image.created=${BUILD_DATE_TIME} \
org.opencontainers.image.version=${VERSION} \
gov.va.build.number=${BUILD_NUMBER} \
gov.va.build.tool=${BUILD_TOOL}