forked from fippo/rtcstats-server
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
35 lines (22 loc) · 845 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
31
32
33
34
35
FROM node:16.13-alpine
RUN apk add --no-cache git && \
rm -rf /var/lib/apt/lists/* /var/cache/apk /usr/share/man /tmp/*
ENV app rtcstats-server
WORKDIR /$app
RUN adduser --disabled-password $app
RUN chown -R $app:$app /$app
USER $app
# Use cached node_modules in case package.json doesn't change.
# The npm install command needs to run before the app files are
# copied otherwise anytime an app file is changed it will invalidate
# the npm install command cache.
COPY --chown=$app:$app package.json package-lock.json /$app/
RUN npm install
COPY --chown=$app:$app . /$app
# This will run in k8s context so we use the heartbeat from there.
# HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \
# CMD curl --silent --fail http://localhost:3000/healthcheck \
# || exit 1
EXPOSE 3000
ENTRYPOINT [ "npm" ]
CMD [ "start" ]