Ship shared projects and CAD reliability updates

This commit is contained in:
Formsmith
2026-07-19 15:58:52 +03:00
parent 3a7db063e7
commit c5ce5a80f0
23 changed files with 999 additions and 83 deletions
+22 -10
View File
@@ -1,28 +1,40 @@
# 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
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
ENV STATIC_EXPORT=true
ENV SKETCHFORGE_DOCKER_BUILD=true
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build && npm run verify:static-worker-assets
RUN npm run build
FROM nginx:stable-alpine AS runner
FROM node:22-alpine AS runner
COPY deploy/docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/web/.next-export /usr/share/nginx/html
WORKDIR /app
EXPOSE 80
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
ENV SKETCHFORGE_SHARED_PROJECTS_DIR=/data/projects
RUN mkdir -p /data/projects && chown node:node /data/projects
COPY --from=builder --chown=node:node /app/apps/web/.next/standalone ./
COPY --from=builder --chown=node:node /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=builder --chown=node:node /app/apps/web/public ./apps/web/public
USER node
EXPOSE 3000
VOLUME ["/data/projects"]
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 wget -q -O - http://127.0.0.1:3000/api/shared-projects | grep -q '"enabled":true' || exit 1
CMD ["nginx", "-g", "daemon off;"]
CMD ["node", "apps/web/server.js"]