forked from nextcloud/whiteboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (23 loc) · 793 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
# syntax=docker/dockerfile:latest
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
FROM node:20.17.0-alpine3.20 AS build
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
ARG NODE_ENV=production
COPY . /app
WORKDIR /app
RUN apk upgrade --no-cache -a && \
apk add --no-cache ca-certificates && \
npm install --global clean-modules && \
npm clean-install && \
clean-modules --yes && \
npm cache clean --force
FROM node:20.17.0-alpine3.20
COPY --from=build --chown=nobody:nobody /app /app
WORKDIR /app
RUN apk upgrade --no-cache -a && \
apk add --no-cache ca-certificates tzdata netcat-openbsd
USER nobody
EXPOSE 3002
ENTRYPOINT ["npm", "run", "server:start"]
HEALTHCHECK CMD nc -z 127.0.0.1 3002 || exit 1