Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -2
Dockerfile
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
FROM node:18-slim
|
2 |
|
3 |
# Install required system dependencies
|
@@ -5,20 +6,26 @@ RUN apt-get update && apt-get install -y \
|
|
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
|
|
|
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 |
build-essential \
|
7 |
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
|
|
9 |
ARG HF_TOKEN
|
10 |
ENV NEXT_PUBLIC_HUGGINGFACE_API_KEY=$HF_TOKEN
|
11 |
|
|
|
12 |
ENV PORT=7860
|
13 |
ENV NODE_ENV=production
|
14 |
|
15 |
+
# Set working directory
|
16 |
WORKDIR /app
|
17 |
|
18 |
+
# Copy package files
|
19 |
COPY package*.json ./
|
20 |
+
|
21 |
+
# Install dependencies
|
22 |
RUN npm install
|
23 |
|
24 |
+
# Copy the rest of the application
|
25 |
COPY . .
|
26 |
+
|
27 |
+
# Build the Next.js application
|
28 |
+
# Note: We don't use turbopack for production builds
|
29 |
RUN npm run build
|
30 |
|
31 |
EXPOSE 7860
|