-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 732 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 732 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
FROM node:20-alpine
WORKDIR /app
# Build toolchain needed to compile better-sqlite3's native addon on Alpine
# (musl). python3/make/g++ are required by node-gyp. We install them, build,
# then drop them in the same layer to keep the image small.
COPY package.json package-lock.json* ./
RUN apk add --no-cache --virtual .build-deps python3 make g++ \
&& npm install --omit=dev --no-audit --no-fund \
&& npm rebuild better-sqlite3 \
&& apk del .build-deps
COPY . .
# Data and uploaded icons should be persisted via a volume.
RUN mkdir -p data/sessions public/icons
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
# Run as the built-in non-root node user.
RUN chown -R node:node /app
USER node
CMD ["node", "server.js"]