Docker update

This commit is contained in:
mukesh13
2025-06-17 15:15:58 +05:30
parent c072eef45b
commit 6a3758bf33

View File

@ -1,35 +1,27 @@
# Use Node.js 18 Alpine for smaller size and faster builds
FROM node:18-alpine FROM node:18-alpine
# Set working directory
WORKDIR /app WORKDIR /app
# Install dependencies for native modules # Install system dependencies
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
# Copy package files # Copy package files
COPY package.json pnpm-lock.yaml* ./ COPY package.json pnpm-lock.yaml* ./
# Enable pnpm and install dependencies # Install pnpm and dependencies
RUN corepack enable pnpm RUN corepack enable pnpm && pnpm install --frozen-lockfile
RUN pnpm install --frozen-lockfile
# Copy source code # Copy all source files
COPY . . COPY . .
# Disable telemetry for faster builds # Disable telemetry
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED=1
# Build the application # Build the app
RUN pnpm run build RUN pnpm build
# Expose port # Expose port
EXPOSE 3000 EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Start the application # Start the application
CMD ["pnpm", "start"] CMD ["pnpm", "start"]