fix dockerfile
This commit is contained in:
+3
-3
@@ -10,13 +10,13 @@ WORKDIR /app
|
|||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install dependencies - leveraging Docker cache
|
# Install dependencies - leveraging Docker cache
|
||||||
RUN npm install --production --frozen-lockfile || yarn install --production --frozen-lockfile
|
RUN npm i --force
|
||||||
|
|
||||||
# Copy the rest of the application code
|
# Copy the rest of the application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the Next.js application
|
# Build the Next.js application
|
||||||
RUN npm run build || yarn build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Production image - smaller and leaner
|
# Stage 2: Production image - smaller and leaner
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
@@ -26,7 +26,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1 # Opt-out of Next.js telemetry
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
# Add a non-root user for security
|
# Add a non-root user for security
|
||||||
RUN addgroup -g 1001 -S nodejs
|
RUN addgroup -g 1001 -S nodejs
|
||||||
|
|||||||
Reference in New Issue
Block a user