Nanny7 commited on
Commit
425980b
·
1 Parent(s): c306fa3

Fix: Use standalone output with proper build

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -6
  2. 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 ci --only=production
12
 
13
  # Copy source code
14
  COPY . .
15
 
16
- # Build the application (static export)
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 with simple HTTP server for static files
31
- RUN npm install -g serve
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: 'export',
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;