feat: docker buildx.
Some checks failed
Build and Push Docker Image / buildx (push) Has been cancelled

This commit is contained in:
2025-11-11 15:09:02 +08:00
parent c8b789afe3
commit f1a88c9890
5 changed files with 102 additions and 8 deletions

View File

@@ -1,12 +1,22 @@
FROM node:25-alpine
FROM node:25-alpine AS base
WORKDIR /app
# Dependencies stage
FROM base AS deps
COPY package*.json ./
RUN npm install --production
# Production stage
FROM base AS production
COPY --from=deps /app/node_modules ./node_modules
COPY . .
EXPOSE 3000
# Create a non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
USER nextjs
CMD ["node", "server.js"]