Files
portfolio/Dockerfile
vorpax 6f5d0fcb35
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 13s
edit theme for my own siye
2026-01-02 16:15:14 +01:00

35 lines
600 B
Docker

# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source files
COPY . .
# Build the site
RUN pnpm build
# Stage 2: Serve with nginx
FROM nginx:alpine AS runner
# Copy built files
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]