Fix dockerfile
Browse files- Dockerfile +5 -2
Dockerfile
CHANGED
|
@@ -15,8 +15,8 @@ RUN apk add --no-cache \
|
|
| 15 |
# Copy package files
|
| 16 |
COPY package*.json ./
|
| 17 |
|
| 18 |
-
# Install dependencies
|
| 19 |
-
RUN npm ci
|
| 20 |
|
| 21 |
# Copy source code
|
| 22 |
COPY . .
|
|
@@ -24,6 +24,9 @@ COPY . .
|
|
| 24 |
# Build the application
|
| 25 |
RUN npm run build
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
# Create non-root user for security
|
| 28 |
RUN addgroup -g 1001 -S nodejs && \
|
| 29 |
adduser -S nextjs -u 1001
|
|
|
|
| 15 |
# Copy package files
|
| 16 |
COPY package*.json ./
|
| 17 |
|
| 18 |
+
# Install dependencies (including dev dependencies for build)
|
| 19 |
+
RUN npm ci
|
| 20 |
|
| 21 |
# Copy source code
|
| 22 |
COPY . .
|
|
|
|
| 24 |
# Build the application
|
| 25 |
RUN npm run build
|
| 26 |
|
| 27 |
+
# Clean up dev dependencies after build
|
| 28 |
+
RUN npm prune --production
|
| 29 |
+
|
| 30 |
# Create non-root user for security
|
| 31 |
RUN addgroup -g 1001 -S nodejs && \
|
| 32 |
adduser -S nextjs -u 1001
|