-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (32 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (32 loc) · 1.2 KB
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
40
41
42
43
44
45
46
47
48
FROM node:24-trixie-slim AS builder
WORKDIR /build
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
RUN npm install -g npm@latest
# Copy package files and install dependencies
COPY --chmod=u=rw,go=r package*.json ./
COPY --chmod=u=rw,go=r packages/common/package*.json ./packages/common/
COPY --chmod=u=rw,go=r packages/lib/package*.json ./packages/lib/
COPY --chmod=u=rw,go=r packages/server/package*.json ./packages/server/
COPY --chmod=u=rw,go=r packages/ui/package*.json ./packages/ui/
RUN --mount=type=cache,target=/root/.npm \
npm ci
# Copy application files
COPY --chmod=u=rw,go=r . .
RUN find . -mindepth 1 -maxdepth 1 -type d ! -name node_modules -exec chmod -R ugo+X {} +
# Test the application
RUN npm run test
# Build the application
RUN --mount=type=cache,target=/root/.npm \
npm run build:release
FROM node:24-trixie-slim AS app
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt upgrade -y \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN NPM_CONFIG_UPDATE_NOTIFIER=false npm install -g npm@latest
COPY --from=builder --chown=node:node /build/dist/ /app
COPY --chmod=u=rwx,go=rx ./entrypoint.sh /entrypoint.sh
EXPOSE 3000
VOLUME /app/data
ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "run", "prod"]