From 3828f170e24a3fedac6fcf7724f33025c5d498a3 Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:32:46 +0100 Subject: [PATCH] feat: add Dockerfile for frontend service Introduce a multi-stage Dockerfile for the frontend service to enable efficient builds and an optimized runtime using Node.js 22. --- frontend/Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 frontend/Dockerfile diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..8bfbb83 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,22 @@ +FROM node:22-slim AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable + +FROM base AS build +WORKDIR /usr/src/app +COPY . . +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile +RUN pnpm run --filter @memegoat/frontend build + +FROM base AS runtime +WORKDIR /app +COPY --from=build /usr/src/app/frontend/public ./frontend/public +COPY --from=build /usr/src/app/frontend/.next/standalone ./ +COPY --from=build /usr/src/app/frontend/.next/static ./frontend/.next/static + +EXPOSE 3000 +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + +CMD ["node", "frontend/server.js"]