🐋 Initial Dockerfile config with .dockerignore

This commit is contained in:
pheralb
2025-08-31 15:35:11 +01:00
parent 374fb8f2d5
commit 2c3fdf79fe
3 changed files with 57 additions and 14 deletions
+19
View File
@@ -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
+38
View File
@@ -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"]
-14
View File
@@ -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"]