Skip to content

Commit e2d3483

Browse files
committed
chore(frontend): add .dockerignore file to exclude unnecessary files from Docker context
1 parent 62a47cc commit e2d3483

File tree

2 files changed

+75
-8
lines changed

2 files changed

+75
-8
lines changed

frontend/.dockerignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dependencies
2+
node_modules
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
8+
# Production builds
9+
.next/
10+
out/
11+
dist/
12+
13+
# Environment variables
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Logs
27+
logs
28+
*.log
29+
30+
# Temporary files
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db
38+
39+
# IDEs and editors
40+
.vscode/
41+
.idea/
42+
*.swp
43+
*.swo
44+
*~
45+
46+
# Git
47+
.git
48+
.gitignore
49+
50+
# Docker
51+
Dockerfile*
52+
docker-compose*
53+
.dockerignore
54+
55+
# Testing
56+
coverage/
57+
.nyc_output
58+
.coverage
59+
60+
# Other
61+
.cache/

frontend/Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@ FROM node:20.15.1-alpine AS builder
44
WORKDIR /app
55

66
# Define build arguments with default values
7-
ARG NEXT_PUBLIC_API_URL=https://api-evoai.evoapicloud.com
7+
ARG NEXT_PUBLIC_API_URL=https://api.evo-ai.co
88

9-
# Instalar pnpm globalmente
109
RUN npm install -g pnpm
1110

12-
# Install dependencies first (caching)
11+
# Copy package files first for better caching
1312
COPY package.json pnpm-lock.yaml ./
13+
14+
# Copy configuration files that are needed for dependency resolution
15+
COPY tsconfig.json ./
16+
COPY next.config.mjs ./
17+
COPY tailwind.config.ts ./
18+
COPY postcss.config.mjs ./
19+
COPY components.json ./
20+
21+
# Install dependencies
1422
RUN pnpm install --no-frozen-lockfile
1523

16-
# Instalar explicitamente o next-runtime-env
1724
RUN pnpm add next-runtime-env
1825

19-
# Copy source code
26+
# Copy all source code
2027
COPY . .
2128

2229
# Set environment variables from build arguments
2330
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
2431

32+
# Build the application
2533
RUN pnpm run build
2634

2735
# Production stage
@@ -32,14 +40,12 @@ WORKDIR /app
3240
# Define build arguments again for the runner stage
3341
ARG NEXT_PUBLIC_API_URL=https://api-evoai.evoapicloud.com
3442

35-
# Instalar pnpm globalmente
3643
RUN npm install -g pnpm
3744

3845
# Install production dependencies only
3946
COPY package.json pnpm-lock.yaml ./
4047
RUN pnpm install --prod --no-frozen-lockfile
4148

42-
# Instalar explicitamente o next-runtime-env na produção
4349
RUN pnpm add next-runtime-env
4450

4551
# Copy built assets from builder
@@ -52,7 +58,7 @@ ENV NODE_ENV=production
5258
ENV PORT=3000
5359
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
5460

55-
# Script to replace environment variables at runtime - create it diretamente no container
61+
# Script to replace environment variables at runtime
5662
COPY docker-entrypoint.sh ./
5763
RUN chmod +x ./docker-entrypoint.sh
5864

0 commit comments

Comments
 (0)