Fix global error page, update CI workflow, add Dockerfile
Some checks failed
Staging Build / build (push) Failing after 34s

This commit is contained in:
DanielS
2026-06-22 22:30:55 +02:00
parent 3eb72481ce
commit 7bb6807d37
3 changed files with 90 additions and 1 deletions

42
Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
# Use a multistage build for a Next.js app
# ---------- Builder stage ----------
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Install dependencies (use package lock when present)
COPY shop/package*.json ./
RUN npm ci --omit=dev
# Copy the source code
COPY shop/ .
# Build the production output
RUN npm run build
# ---------- Runtime stage ----------
FROM node:20-alpine AS runner
WORKDIR /app
# Copy only the built assets and runtime dependencies from the builder
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/next.config.mjs ./
COPY --from=builder /app/next-env.d.ts ./
COPY --from=builder /app/tsconfig.json ./
# Install production dependencies (already installed in builder, but ensure they are present)
RUN npm ci --omit=dev
# Environment variables
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
# Start the Next.js server
CMD ["npm", "run", "start"]