-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (33 loc) · 884 Bytes
/
Copy pathDockerfile
File metadata and controls
48 lines (33 loc) · 884 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:22-alpine AS builder
RUN apk add --no-cache \
ffmpeg \
python3 \
make \
g++ \
rsync
WORKDIR /app
COPY package*.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN node scripts/compile.mjs backend \
&& npm rebuild better-sqlite3 \
&& npx vite build
FROM node:22-alpine AS runner
RUN apk add --no-cache ffmpeg
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts \
&& npm rebuild better-sqlite3
COPY --from=builder /app/app ./app
COPY --from=builder /app/api ./api
COPY --from=builder /app/shared ./shared
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/public ./public
RUN mkdir -p /app/app_storage \
&& addgroup -g 1001 -S nodejs \
&& adduser -S nodejs -u 1001 -G nodejs \
&& chown -R nodejs:nodejs /app
USER nodejs
EXPOSE 12321
ENV NODE_ENV=production
CMD ["node", "app/server.js"]