-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 770 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 770 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
FROM node:22-slim AS builder
WORKDIR /app
# Install rbw
RUN apt-get update && apt-get install -y rbw
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application
COPY . .
# Build the project
RUN npm run build
FROM gcr.io/distroless/nodejs22-debian12:nonroot AS release
WORKDIR /app
USER nonroot
# Copy rbw binary from builder stage
COPY --from=builder /usr/bin/rbw /usr/bin/rbw
# Copy built application and node_modules from builder stage
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
ENV NODE_ENV=production
# The bin script in package.json points to dist/index.js
CMD ["dist/index.js"]