-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile.landing
More file actions
34 lines (22 loc) · 1.06 KB
/
Copy pathDockerfile.landing
File metadata and controls
34 lines (22 loc) · 1.06 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
# Force the builder stage to run natively on the CI runner arch (amd64 on GH hosted),
# so pnpm install + vite build aren't executed under QEMU arm64 emulation (30min+ -> ~3min).
# Output is a plain dist/ (static files), copied into the TARGETPLATFORM runtime image below.
FROM --platform=$BUILDPLATFORM node:22.12.0-bookworm-slim AS builder
WORKDIR /workspace
RUN npm install -g pnpm@10.32.1
# Copy workspace scaffolding
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
COPY apps/landing ./apps/landing
COPY packages ./packages
RUN pnpm install --filter @opentickly/landing... --no-frozen-lockfile --ignore-scripts
RUN pnpm --filter @opentickly/landing run postinstall
RUN pnpm --filter @opentickly/landing run build
# ---
FROM node:22.12.0-bookworm-slim
RUN npm install -g serve@14
WORKDIR /app
COPY --from=builder --chown=node:node /workspace/apps/landing/dist ./dist
COPY --from=builder --chown=node:node /workspace/apps/landing/serve.json ./dist/serve.json
USER node
EXPOSE 8080
CMD ["sh", "-c", "serve -c serve.json -l ${PORT:-8080} ./dist"]