-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (34 loc) · 809 Bytes
/
Dockerfile
File metadata and controls
41 lines (34 loc) · 809 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
39
40
41
###################
# Create base image with PNPM installed
###################
FROM node:22-alpine3.21 AS base
ENV CI=1
RUN apk --no-cache add libc6-compat
RUN npm install -g pnpm@10
###################
# Copy just my dependency files
###################
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml .env ./
COPY ssl ./ssl
COPY templates ./templates
COPY bin ./bin
###################
# Install all dependencies and build
###################
FROM deps AS builder
WORKDIR /app
RUN pnpm fetch
COPY . .
RUN pnpm install --offline
RUN pnpm build
###################
# Install production only dependencies
###################
FROM deps AS runner
ENV NODE_ENV production
RUN pnpm fetch --prod
COPY --from=builder /app/dist ./dist
RUN pnpm install --offline --prod
CMD [ "pnpm", "start" ]