Spaces:
Build error
Build error
Zerotracex-Stuff
commited on
Commit
·
3f7575f
1
Parent(s):
df52141
First model version
Browse files- Dockerfile +23 -14
- next.config.ts +0 -1
- package.json +1 -0
Dockerfile
CHANGED
|
@@ -1,23 +1,32 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
-
COPY package
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY . .
|
| 10 |
-
# Install dependencies
|
| 11 |
-
RUN npm install
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
# Expose the port your app runs on
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
CMD ["
|
|
|
|
| 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",
|