feat: Docker bidez altxatzea ahalbidetzen du

This commit is contained in:
2026-08-17 10:10:10 +02:00
parent 3b7d04d9db
commit 2f18aa81bd
4 changed files with 45 additions and 1 deletions

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
# 1.- Builder
FROM node:24.19.0-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json astro.config.mjs tsconfig.json ./
COPY src ./src
COPY public ./public
# RUN npm install -g npm@12.0.2
RUN npm install
RUN npm run build
# 2.- Runtime
FROM node:24.19.0-alpine AS runner
WORKDIR /app
# Only copy necessary files
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nodejs -u 1001
USER nodejs
EXPOSE 4321
CMD ["node", "dist/server/entry.mjs"]