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
|
# 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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
- next-cache:/app/.next/cache
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
next-cache:
|
||||||
4950
pnpm-lock.yaml
generated
4950
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user