-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 751 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 751 Bytes
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
FROM docker.io/node:24-alpine3.20
LABEL maintainer="Said Sef <saidsef@gmail.com> (saidsef.co.uk/)"
ARG BUILD_ID=""
ARG PORT=""
ENV NODE_ENV production
ENV NPM_CONFIG_FETCH_RETRIES 10
ENV NPM_CONFIG_LOGLEVEL warn
ENV BUILD_ID ${BUILD_ID:-'0.0.0.0-boo!'}
ENV PORT ${PORT:-8080}
WORKDIR /code
COPY ./app/ /code
RUN echo "${BUILD_ID}" > build_id.txt
RUN apk add --update --no-cache curl && \
rm -rfv /var/cache/apk/* && \
yarn install --prod && \
yarn check && \
yarn autoclean --init && \
yarn autoclean --force && \
chown -R nobody .
USER nobody
EXPOSE ${PORT}
# health check endpoint
HEALTHCHECK --interval=60s --timeout=10s CMD curl --fail 'http://localhost:${PORT}/healthz' || exit 1
CMD /usr/local/bin/node index.js