From 2c3fdf79fe134f6efc3a962ee5c12a9355211706 Mon Sep 17 00:00:00 2001 From: pheralb Date: Sun, 31 Aug 2025 15:35:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8B=20Initial=20Dockerfile=20config=20?= =?UTF-8?q?with=20.dockerignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 19 +++++++++++++++++++ Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ nixpacks.toml | 14 -------------- 3 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile delete mode 100644 nixpacks.toml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a6553d8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +Dockerfile +.dockerignore +.git +.gitignore +.gitattributes +README.md +.npmrc +.prettierrc +prettier.config.mjs +.eslintrc.cjs +eslint.config.mjs +.graphqlrc +.editorconfig +.svelte-kit +.vscode +node_modules +build +package +**/.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc90f2b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM node:22.17.0-alpine AS base + +# Install pnpm +RUN npm install -g pnpm@10.13.1 + +# Set working directory +WORKDIR /app + +# Install dependencies with cache +FROM base AS deps +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +# Build the application +FROM base AS builder +COPY --from=deps /app/node_modules ./node_modules +COPY . . +ENV PUBLIC_SVGL_VERSION=beta +RUN pnpm run build:prod + +# Production image +FROM node:22.17.0-alpine AS runner +WORKDIR /app + +# Copy necessary files from builder +COPY --from=builder /app/build ./build +COPY --from=builder /app/node_modules ./node_modules +COPY package.json ./ + +# Set production environment +ENV NODE_ENV=production +ENV PUBLIC_SVGL_VERSION=beta + +# Expose port +EXPOSE 3000 + +# Start the server +CMD ["node", "build"] \ No newline at end of file diff --git a/nixpacks.toml b/nixpacks.toml deleted file mode 100644 index 3df7bc4..0000000 --- a/nixpacks.toml +++ /dev/null @@ -1,14 +0,0 @@ -providers = ["node"] - -[variables] -NODE_VERSION = "22.17.0" - -[phases.build] -cmds = [ - "npm install -g corepack", - "corepack enable", - "corepack prepare pnpm@10.13.1 --activate" -] - -[phases.install] -cmds = ["corepack pnpm install"]