-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 755 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (21 loc) · 755 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
# Build stage
FROM alpine:3.20 AS build
WORKDIR /app
RUN apk add --no-cache nodejs npm
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN npm run build && npm prune --omit=dev
# Production stage
FROM alpine:3.20 AS runtime
WORKDIR /app
RUN apk add --no-cache nodejs openssl \
&& addgroup -S app \
&& adduser -S -G app app
COPY --from=build /app/package.json /app/package-lock.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY config.jsonc /app/config.json
RUN mkdir -p /app/data
EXPOSE 443 8883 1884 46030 47878 44401
CMD ["sh", "-c", "[ -f /app/data/config.json ] || cp /app/config.json /app/data/config.json; exec node dist/rethink-cloud.js /app/data/config.json"]