Docker config
This commit is contained in:
49
.dockerignore
Normal file
49
.dockerignore
Normal 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
|
||||
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
|
||||
|
||||
|
||||
@ -8,7 +8,11 @@ services:
|
||||
- "8091:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- NEXT_TELEMETRY_DISABLED=1
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
- next-cache:/app/.next/cache
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
next-cache:
|
||||
4910
pnpm-lock.yaml
generated
4910
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user