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:
@@ -1,10 +1,19 @@
|
|||||||
# See https://docs.docker.com/desktop/extensions-sdk/extensions/ignore/ for more details.
|
# Ignore root Next.js project
|
||||||
node_modules
|
../package.json
|
||||||
dist
|
../package-lock.json
|
||||||
*.log
|
../next.config.*
|
||||||
.git
|
../src/
|
||||||
|
../public/
|
||||||
|
../.next/
|
||||||
|
../node_modules/
|
||||||
|
|
||||||
|
# Ignore build artifacts
|
||||||
|
dist/
|
||||||
|
node_modules/
|
||||||
|
.git/
|
||||||
.gitignore
|
.gitignore
|
||||||
README.md
|
|
||||||
.env
|
# Ignore other projects
|
||||||
.env.*
|
*/.next/
|
||||||
!node_modules/.dockerignore
|
*/dist/
|
||||||
|
*/node_modules/
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ COPY package*.json ./
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm ci --omit=dev
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
# Copy source code
|
# Copy all source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build Astro project (includes public folder in dist)
|
# Build Astro project (includes public folder in dist)
|
||||||
|
|||||||
Reference in New Issue
Block a user