-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (32 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
48 lines (32 loc) · 1.26 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:22-alpine3.22 AS build
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY tsconfig*.json ./
COPY tsconfig ./tsconfig
RUN corepack prepare --activate
RUN pnpm install --frozen-lockfile
COPY src ./src
RUN pnpm run build
# Production stage - uses assets from build stage to reduce image size
FROM node:22-alpine3.22
RUN apk add --update dumb-init
# Avoid zombie processes, handle signal forwarding
ENTRYPOINT ["dumb-init", "--"]
WORKDIR /app
# Copy package files and node_modules from build stage (includes compiled native modules)
COPY package.json pnpm-lock.yaml .npmrc ./
COPY --from=build /app/node_modules ./node_modules
# Prune devDependencies to reduce image size
RUN corepack enable && corepack prepare --activate
RUN pnpm prune --prod
COPY --from=build /app/dist ./dist
COPY entrypoint.js ./entrypoint.js
EXPOSE 2588
ENV AP_PORT=2588
ENV NODE_ENV=production
ENV NODE_OPTIONS="--import @opentelemetry/auto-instrumentations-node/register"
CMD ["node", "--enable-source-maps", "entrypoint.js"]
LABEL org.opencontainers.image.source=https://github.com/msonnb/fedisky
LABEL org.opencontainers.image.description="Fedisky - ActivityPub federation sidecar for ATProto PDS"
LABEL org.opencontainers.image.licenses=MIT