-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (34 loc) · 1.07 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
FROM node:22-alpine AS builder
WORKDIR /app
RUN apk add --no-cache python3 make g++
COPY package*.json ./
# Satisfy engines.npm (node:22 bundles npm 10). npm ci installs from the
# lockfile verbatim, so the min-release-age cooldown does not apply here.
RUN npm install -g npm@11
RUN npm ci
COPY src ./src
COPY scripts ./scripts
COPY static ./static
COPY messages ./messages
COPY project.inlang ./project.inlang
COPY drizzle.config.ts ./
COPY vite.config.ts ./
COPY svelte.config.js ./
COPY tsconfig.json ./
# Stage builds pass the short commit SHA so the app surfaces a dev-flavoured
# version (`<version>-dev+<sha>`); prod builds leave it empty (ADR-0012).
ARG BUILD_SHA=
ENV BUILD_SHA=$BUILD_SHA
ENV DATABASE_URL=build
RUN npm run build
RUN npm prune --production
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY --from=builder /app/src/lib/server/db/migrations src/lib/server/db/migrations/
COPY --from=builder /app/package.json ./
EXPOSE 3000
CMD ["node", "build"]