Docker config
This commit is contained in:
18
Dockerfile
18
Dockerfile
@ -4,18 +4,24 @@ FROM node:20-alpine
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and pnpm-lock.yaml (if it exists)
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
# Copy only dependency files first
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install
|
||||
# Install dependencies with pnpm
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Create a cache directory for Next.js
|
||||
RUN mkdir -p /app/.next/cache
|
||||
|
||||
# Disable telemetry
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Build the Next.js application
|
||||
RUN pnpm build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user