Files
snapcad-studio/deploy/docker/Dockerfile
T

28 lines
779 B
Docker
Raw Normal View History

2026-06-20 10:07:33 +03:00
# syntax=docker/dockerfile:1
# The exported web app is architecture-independent. Build it once on the
# native GitHub runner instead of repeating npm/Next.js under arm64 QEMU.
FROM --platform=$BUILDPLATFORM node:22-alpine AS builder
2026-06-20 10:07:33 +03:00
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
ENV STATIC_EXPORT=true
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
2026-07-11 20:34:13 +03:00
RUN npm run build && npm run verify:static-worker-assets
2026-06-20 10:07:33 +03:00
FROM nginx:stable-alpine AS runner
2026-06-20 10:18:54 +03:00
COPY deploy/docker/nginx.conf /etc/nginx/conf.d/default.conf
2026-07-11 20:34:13 +03:00
COPY --from=builder /app/apps/web/.next-export /usr/share/nginx/html
2026-06-20 10:07:33 +03:00
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD wget -q -O - http://127.0.0.1/healthz | grep -q '^ok$' || exit 1
CMD ["nginx", "-g", "daemon off;"]