-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
39 lines (25 loc) · 802 Bytes
/
Dockerfile
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
FROM node:21-alpine as deps-prod
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN corepack enable && pnpm -r i --frozen-lockfile --prod
# ? -------------------------
FROM node:21-alpine as builder
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN corepack enable && pnpm -r i --frozen-lockfile
COPY astro.config.mjs tailwind.config.cjs tsconfig.json ./
COPY public ./public
COPY src ./src
RUN pnpm build
# ? -------------------------
FROM gcr.io/distroless/nodejs20-debian12:nonroot as runner
USER nonroot
EXPOSE 8080
ENV NODE_ENV production
ENV PORT 8080
ENV TZ="Asia/Bangkok"
COPY package.json ./
COPY --chown=nonroot:nonroot --from=deps-prod /app/node_modules ./node_modules
COPY --chown=nonroot:nonroot --from=builder /app/dist ./dist
COPY server.mjs ./
CMD ["./server.mjs"]