Zerotracex-Stuff commited on
Commit
3f7575f
·
1 Parent(s): df52141

First model version

Browse files
Files changed (3) hide show
  1. Dockerfile +23 -14
  2. next.config.ts +0 -1
  3. package.json +1 -0
Dockerfile CHANGED
@@ -1,23 +1,32 @@
1
- # Use the official Node.js image as the base image
2
- FROM node:20-slim
 
3
 
4
- # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy package.json and package-lock.json to the working directory
8
- COPY package*.json ./
 
 
 
 
 
9
  COPY . .
10
- # Install dependencies
11
- RUN npm install
12
 
13
- # Install a static file server
14
- RUN npm install -g serve
 
 
 
 
 
15
 
16
- # Build and export the Next.js static site
17
- RUN npm run build
 
18
 
19
- # Expose the port your app runs on. Use 7860 as per the user's requirement.
20
  EXPOSE 7860
21
 
22
- # Command to serve the static site
23
- CMD ["serve", "-s", "out", "-l", "7860"]
 
1
+ # Use official Node.js image as base
2
+ ARG BASE=node:20-slim
3
+ FROM ${BASE} AS base
4
 
 
5
  WORKDIR /app
6
 
7
+ # Copy dependency files
8
+ COPY package.json package-lock.json ./
9
+
10
+ # Install pnpm and dependencies
11
+ RUN npm install -g pnpm && pnpm install
12
+
13
+ # Copy the rest of the source code
14
  COPY . .
 
 
15
 
16
+ # Build Next.js app
17
+ RUN pnpm run build
18
+
19
+ # Production image
20
+ FROM base AS production
21
+
22
+ WORKDIR /app
23
 
24
+ # Set environment variables for Hugging Face Spaces
25
+ ENV PORT=7860 \
26
+ NODE_ENV=production
27
 
28
+ # Expose the port your app runs on
29
  EXPOSE 7860
30
 
31
+ # Start the Next.js app
32
+ CMD ["pnpm", "start"]
next.config.ts CHANGED
@@ -1,7 +1,6 @@
1
  import type {NextConfig} from 'next';
2
 
3
  const nextConfig: NextConfig = {
4
- output: 'export',
5
  /* config options here */
6
  typescript: {
7
  ignoreBuildErrors: true,
 
1
  import type {NextConfig} from 'next';
2
 
3
  const nextConfig: NextConfig = {
 
4
  /* config options here */
5
  typescript: {
6
  ignoreBuildErrors: true,
package.json CHANGED
@@ -1,3 +1,4 @@
 
1
  {
2
  "name": "nextn",
3
  "version": "0.1.0",
 
1
+
2
  {
3
  "name": "nextn",
4
  "version": "0.1.0",