mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🐋 Initial Dockerfile config with .dockerignore
This commit is contained in:
@@ -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
@@ -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"]
|
||||
@@ -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"]
|
||||
Reference in New Issue
Block a user