Docker config

This commit is contained in:
mukesh13
2025-06-16 18:18:18 +05:30
parent da3df17022
commit 4be1a13441
4 changed files with 2987 additions and 2036 deletions

49
.dockerignore Normal file
View File

@ -0,0 +1,49 @@
# Ignore node_modules (already installed in the container)
node_modules/
# Ignore Next.js build output
.next/
out/
# Ignore Git-related files
.git/
.gitignore
# Ignore environment files (sensitive data)
.env
.env.local
.env.development
.env.production
.env*.local
# Ignore build artifacts and caches
.cache/
# Ignore logs and temporary files
logs/
*.log
*.tmp
*.temp
# Ignore editor-specific files
.vscode/
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln
*.swp
# Ignore OS-specific files
.DS_Store
Thumbs.db
# Ignore TypeScript build info
*.tsbuildinfo
# Ignore coverage reports
coverage/
# Ignore Docker-related files (optional, since they're small)
# Dockerfile
# docker-compose.yml

View File

@ -4,18 +4,24 @@ FROM node:20-alpine
# Set working directory # Set working directory
WORKDIR /app 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* ./ COPY package.json pnpm-lock.yaml* ./
# Install pnpm # Install dependencies with pnpm
RUN npm install -g pnpm RUN pnpm install --frozen-lockfile
# Install dependencies
RUN pnpm install
# Copy the rest of the application code # Copy the rest of the application code
COPY . . 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 # Build the Next.js application
RUN pnpm build RUN pnpm build

View File

@ -8,7 +8,11 @@ services:
- "8091:3000" - "8091:3000"
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- NEXT_TELEMETRY_DISABLED=1
volumes: volumes:
- .:/app - .:/app
- /app/node_modules - /app/node_modules
restart: unless-stopped - next-cache:/app/.next/cache
restart: unless-stopped
volumes:
next-cache:

4950
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff