Fix: Use standalone output with proper build
Browse files- Dockerfile +5 -6
- next.config.js +2 -3
Dockerfile
CHANGED
|
@@ -7,13 +7,13 @@ WORKDIR /app
|
|
| 7 |
# Copy package files
|
| 8 |
COPY package*.json ./
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
-
RUN npm
|
| 12 |
|
| 13 |
# Copy source code
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
# Build the application
|
| 17 |
RUN npm run build
|
| 18 |
|
| 19 |
# Create data directory for persistent storage
|
|
@@ -27,6 +27,5 @@ ENV NODE_ENV=production
|
|
| 27 |
ENV PORT=7860
|
| 28 |
ENV DATA_DIR=/data
|
| 29 |
|
| 30 |
-
# Start
|
| 31 |
-
|
| 32 |
-
CMD ["serve", "-s", "out", "-l", "7860"]
|
|
|
|
| 7 |
# Copy package files
|
| 8 |
COPY package*.json ./
|
| 9 |
|
| 10 |
+
# Install ALL dependencies (including devDependencies for build)
|
| 11 |
+
RUN npm install
|
| 12 |
|
| 13 |
# Copy source code
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
+
# Build the application
|
| 17 |
RUN npm run build
|
| 18 |
|
| 19 |
# Create data directory for persistent storage
|
|
|
|
| 27 |
ENV PORT=7860
|
| 28 |
ENV DATA_DIR=/data
|
| 29 |
|
| 30 |
+
# Start the standalone Next.js application
|
| 31 |
+
CMD ["node", "server.js"]
|
|
|
next.config.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
const nextConfig = {
|
| 3 |
-
output: '
|
| 4 |
images: {
|
| 5 |
unoptimized: true
|
| 6 |
-
}
|
| 7 |
-
trailingSlash: true
|
| 8 |
};
|
| 9 |
|
| 10 |
module.exports = nextConfig;
|
|
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
const nextConfig = {
|
| 3 |
+
output: 'standalone',
|
| 4 |
images: {
|
| 5 |
unoptimized: true
|
| 6 |
+
}
|
|
|
|
| 7 |
};
|
| 8 |
|
| 9 |
module.exports = nextConfig;
|