fullstuckdev commited on
Commit
64eb1f6
·
verified ·
1 Parent(s): 9e004f6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -15
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # Use Node.js 18 as the base image (compatible with Next.js 15)
2
  FROM node:18-slim
3
 
4
  # Install required system dependencies
@@ -6,28 +5,22 @@ RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- ARG NEXT_PUBLIC_HUGGINGFACE_API_KEY
 
 
10
 
11
- ENV NEXT_PUBLIC_HUGGINGFACE_API_KEY=$NEXT_PUBLIC_HUGGINGFACE_API_KEY
 
 
12
 
13
- # Set working directory
14
  WORKDIR /app
15
 
16
- # Copy package files
17
  COPY package*.json ./
18
-
19
- # Install dependencies
20
  RUN npm install
21
 
22
- # Copy the rest of the application
23
  COPY . .
24
-
25
- # Build the Next.js application
26
- # Note: We don't use turbopack for production builds
27
  RUN npm run build
28
 
29
- # Expose the port the app runs on
30
- EXPOSE 3000
31
 
32
- # Start the application
33
- CMD ["npm", "start"]
 
 
1
  FROM node:18-slim
2
 
3
  # Install required system dependencies
 
5
  build-essential \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Match the secret name from Hugging Face
9
+ ARG HF_TOKEN
10
+ ENV NEXT_PUBLIC_HUGGINGFACE_API_KEY=$HF_TOKEN
11
 
12
+ # Set environment variables for Hugging Face Spaces
13
+ ENV PORT=7860
14
+ ENV NODE_ENV=production
15
 
 
16
  WORKDIR /app
17
 
 
18
  COPY package*.json ./
 
 
19
  RUN npm install
20
 
 
21
  COPY . .
 
 
 
22
  RUN npm run build
23
 
24
+ EXPOSE 7860
 
25
 
26
+ CMD ["npm", "start", "--", "-p", "7860"]