-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (26 loc) · 862 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
40
41
FROM cgr.dev/chainguard/node:18 as deps-prod
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN npx pnpm -r i --frozen-lockfile --prod
# ? -------------------------
FROM cgr.dev/chainguard/node:18 as builder
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN npx pnpm -r i --frozen-lockfile
COPY astro.config.mjs tailwind.config.cjs tsconfig.json ./
COPY public ./public
COPY src ./src
RUN npx pnpm build
# ? -------------------------
# Use -dev variant for debugging with bash attatched
# https://edu.chainguard.dev/chainguard/chainguard-images/reference/node/image_specs/
FROM cgr.dev/chainguard/node:18 AS runner
EXPOSE 8080
ENV NODE_ENV production
ENV PORT 8080
ENV TZ="Asia/Bangkok"
COPY package.json ./
COPY --from=deps-prod /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY server.mjs ./
CMD ["./server.mjs"]