Files
meezi/docker/website/Dockerfile
T
soroush.asadi 03376b3ea1 feat(docker): multi-stage Dockerfiles with npmmirror registry
Rewrites dashboard and finder Dockerfiles to use a clean multi-stage
build (deps → builder → runner) that installs npm packages inside
Alpine Linux, avoiding the SWC musl binary issue when building from
Windows host. Uses registry.npmmirror.com for reliable installs from
restricted networks (Iran).

- docker/api/Dockerfile: .NET 10 multi-stage build
- docker/web/Dockerfile: Node 20-alpine multi-stage, npmmirror
- docker/finder/Dockerfile: Node 20-alpine multi-stage, npmmirror
- docker/website/Dockerfile: marketing website build
- scripts/: PowerShell helper scripts for local dev

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:33:29 +03:30

42 lines
1.2 KiB
Docker

FROM meezi-node:20-alpine AS builder
WORKDIR /app
COPY web/website/ .
ARG MEEZI_API_URL=http://api:8080
ENV MEEZI_API_URL=$MEEZI_API_URL
ARG NEXT_PUBLIC_SITE_URL=http://localhost:3010
ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
RUN NEXT_VER=$(node -e "process.stdout.write(require('./node_modules/next/package.json').version)") \
&& rm -rf node_modules/@next/swc-win32-* node_modules/@next/swc-darwin-* 2>/dev/null; \
ls node_modules/@next/swc-linux-x64-musl 2>/dev/null \
|| npm install --no-save --ignore-scripts "@next/swc-linux-x64-musl@${NEXT_VER}"
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
FROM meezi-node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Blog MDX content is read at runtime by process.cwd()
COPY --from=builder /app/src/content ./src/content
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]