From b1c26b762aaf008d48f3e9e34db2e616131c9728 Mon Sep 17 00:00:00 2001 From: br0kenpixel <23280129+br0kenpixel@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:31:49 +0100 Subject: [PATCH] feat: setup `Dockerfile` for frontend --- frontend/.dockerignore | 8 ++++++++ frontend/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 frontend/.dockerignore create mode 100644 frontend/Dockerfile diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..4103166 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,8 @@ +.nuxt/ +.output/ +.env* +node_modules/ +cypress/ +cypress.config.ts +package-lock.json +*.md \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..2d51834 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,37 @@ +# Build Stage 1 + +FROM node:22-alpine AS build +WORKDIR /app + +RUN corepack enable + +# Copy package.json and your lockfile +COPY package.json ./ + +# Install dependencies +RUN pnpm i + +# Copy the entire project +COPY . ./ + +# Prepare Nuxt (generates .nuxt with type definitions and auto-imports) +RUN pnpm run postinstall + +# Build the project +RUN pnpm run build + +# Build Stage 2 + +FROM node:22-alpine +WORKDIR /app + +# Only `.output` folder is needed from the build stage +COPY --from=build /app/.output/ ./ + +# Change the port and host +ENV PORT=80 +ENV HOST=0.0.0.0 + +EXPOSE 80 + +CMD ["node", "/app/server/index.mjs"]