Commit ·
2b66827
1
Parent(s): 2a17081
Fix Dockerfile build process
Browse files- Install all dependencies (including dev) for build step
- Remove dev dependencies after build to reduce image size
- This fixes the 'next: not found' error during build
- Dockerfile +5 -2
Dockerfile
CHANGED
|
@@ -7,8 +7,8 @@ WORKDIR /app
|
|
| 7 |
# Copy package files
|
| 8 |
COPY package*.json ./
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
-
RUN npm ci
|
| 12 |
|
| 13 |
# Copy the rest of the application
|
| 14 |
COPY . .
|
|
@@ -16,6 +16,9 @@ COPY . .
|
|
| 16 |
# Build the application
|
| 17 |
RUN npm run build
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Expose the port that the app runs on
|
| 20 |
EXPOSE 3000
|
| 21 |
|
|
|
|
| 7 |
# Copy package files
|
| 8 |
COPY package*.json ./
|
| 9 |
|
| 10 |
+
# Install all dependencies (including dev dependencies for build)
|
| 11 |
+
RUN npm ci
|
| 12 |
|
| 13 |
# Copy the rest of the application
|
| 14 |
COPY . .
|
|
|
|
| 16 |
# Build the application
|
| 17 |
RUN npm run build
|
| 18 |
|
| 19 |
+
# Remove dev dependencies to reduce image size
|
| 20 |
+
RUN npm prune --production
|
| 21 |
+
|
| 22 |
# Expose the port that the app runs on
|
| 23 |
EXPOSE 3000
|
| 24 |
|