Files
jmap-webmail/Dockerfile
T
Matthieu MALVACHE 05f339283d feat(docker): add GHCR publish workflow and OCI image labels
Automate multi-arch Docker image builds (amd64+arm64) on push to main
or version tags via GitHub Actions. Add OCI metadata labels for GHCR
discoverability. Update release script to sync infra files to
public-release branch.
2026-02-21 23:28:51 +01:00

29 lines
970 B
Docker

FROM node:24-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npx next build --webpack
FROM node:24-alpine AS runner
LABEL org.opencontainers.image.title="JMAP Webmail"
LABEL org.opencontainers.image.description="Modern webmail client built with Next.js and the JMAP protocol"
LABEL org.opencontainers.image.source="https://github.com/root-fr/jmap-webmail"
LABEL org.opencontainers.image.url="https://github.com/root-fr/jmap-webmail"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.vendor="root.cloud"
WORKDIR /app
ENV NODE_ENV=production
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
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]