Nanny7 commited on
Commit
c306fa3
·
1 Parent(s): 81d5383

Convert to static export for faster builds

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -5
  2. next.config.js +2 -7
Dockerfile CHANGED
@@ -8,13 +8,13 @@ WORKDIR /app
8
  COPY package*.json ./
9
 
10
  # Install dependencies
11
- RUN npm ci --only=production 2>&1 | tee /tmp/npm-install.log
12
 
13
  # Copy source code
14
  COPY . .
15
 
16
- # Build the application
17
- RUN npm run build 2>&1 | tee /tmp/npm-build.log
18
 
19
  # Create data directory for persistent storage
20
  RUN mkdir -p /data/sessions /data/uploads
@@ -27,5 +27,6 @@ ENV NODE_ENV=production
27
  ENV PORT=7860
28
  ENV DATA_DIR=/data
29
 
30
- # Start the application
31
- CMD ["npm", "start"]
 
 
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
20
  RUN mkdir -p /data/sessions /data/uploads
 
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"]
next.config.js CHANGED
@@ -1,15 +1,10 @@
1
  /** @type {import('next').NextConfig} */
2
  const nextConfig = {
3
- output: 'standalone',
4
  images: {
5
- domains: ['huggingface.co', 'cdn-lfs.hf.co'],
6
  unoptimized: true
7
  },
8
- experimental: {
9
- serverActions: {
10
- bodySizeLimit: '50mb'
11
- }
12
- }
13
  };
14
 
15
  module.exports = nextConfig;
 
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;