Merge branch 'feature/pipeline' into 'dev'

Add Dockerfile and GitLab CI pipeline for deployment

See merge request rheinsw/website!1
This commit is contained in:
2025-03-29 11:42:07 +00:00
parent f772f0df2e
commit a6ded9245f
2 changed files with 127 additions and 0 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Use lightweight Node.js 20 base image
FROM node:20-alpine as builder
# Set working directory
WORKDIR /app
# Copy package files separately for better Docker caching
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy entire project
COPY . .
# Build the Next.js app
RUN npm run build
# Use a minimal base image for running the app
FROM node:20-alpine
WORKDIR /app
# Copy built files from the builder stage
COPY --from=builder /app ./
# Expose port
EXPOSE 3000
# Start Next.js in production mode
CMD ["npm", "run", "start"]