EXP3 / Dockerfile
SuriRaja's picture
Update Dockerfile
68063f7 verified
raw
history blame contribute delete
525 Bytes
# STEP 1: Install and build the Next.js app
FROM node:20-alpine AS builder
WORKDIR /app
# Copy and install dependencies
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
# Copy rest of the project
COPY . .
# Build static site with Tailwind CSS
RUN pnpm build && pnpm export
# STEP 2: Serve with NGINX
FROM nginx:alpine
# Copy exported static site to NGINX's default public dir
COPY --from=builder /app/out /usr/share/nginx/html
# Expose port 80
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]