fix: Add .dockerignore to exclude Next.js root from Astro build

- Ignore root package.json and Next.js files
- Prevents npm from finding wrong project
- Ensures only Astro code is built

Fixes build error where Next.js code was being compiled.
This commit is contained in:
Kunthawat Greethong
2026-03-03 10:17:47 +07:00
parent 07158311e2
commit b8e372ca96
2 changed files with 19 additions and 10 deletions

View File

@@ -1,10 +1,19 @@
# See https://docs.docker.com/desktop/extensions-sdk/extensions/ignore/ for more details.
node_modules
dist
*.log
.git
# Ignore root Next.js project
../package.json
../package-lock.json
../next.config.*
../src/
../public/
../.next/
../node_modules/
# Ignore build artifacts
dist/
node_modules/
.git/
.gitignore
README.md
.env
.env.*
!node_modules/.dockerignore
# Ignore other projects
*/.next/
*/dist/
*/node_modules/

View File

@@ -9,7 +9,7 @@ COPY package*.json ./
# Install dependencies
RUN npm ci --omit=dev
# Copy source code
# Copy all source code
COPY . .
# Build Astro project (includes public folder in dist)