-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (22 loc) · 744 Bytes
/
Dockerfile
File metadata and controls
38 lines (22 loc) · 744 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
ARG NODE_VERSION=22
# Stage 1: Build
FROM node:${NODE_VERSION}-alpine AS builder
WORKDIR /app
RUN corepack enable && corepack prepare pnpm@latest --activate
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
# Stage 2: Production
FROM node:${NODE_VERSION}-alpine AS production
ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache tini
# SvelteKit adapter-node bundles devDependencies via Rollup
# If you add packages to "dependencies", you must also copy node_modules
COPY --from=builder --chown=node:node /app/build ./build
USER node
EXPOSE 3000
HEALTHCHECK CMD wget --no-verbose --spider http://127.0.0.1:3000/ || exit 1
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "build"]