-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
39 lines (31 loc) · 1.25 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
FROM node:18.17.1-alpine3.17@sha256:7186663f5c94e0f5e389304c748a2d5b5e5f8c941d305c3bae4f68a70b264261
ARG appPort=3000
LABEL maintainer="Damien Laureaux <[email protected]>" \
org.label-schema.vendor="Timoa" \
org.label-schema.name="Node.js encryption API example" \
org.label-schema.description="Node.js encryption API example" \
org.label-schema.url="https://timoa.com" \
org.label-schema.vcs-url="https://github.com/timoa/nodejs-encryption-api-example" \
org.label-schema.version=latest \
org.label-schema.schema-version="1.0"
RUN \
apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates && update-ca-certificates && \
rm -rf /var/cache/apk/* && \
npm install -g npm@latest && \
mkdir -p /opt/app && \
adduser -S app-user
WORKDIR /opt/app/
COPY ./package.json ./
COPY ./src ./src
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s \
CMD npm run docker:status
RUN \
npm install --production --unsafe-perm && \
npm cache clean --force
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.5.0/wait /wait
RUN chmod +x /wait && chown -R app-user /opt/app
USER app-user
EXPOSE ${appPort}
CMD /wait && npm start