Commit ·
d438055
1
Parent(s): 0e7c545
Update
Browse files- Dockerfile +11 -9
Dockerfile
CHANGED
|
@@ -1,22 +1,24 @@
|
|
| 1 |
-
FROM node:20-
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
RUN
|
| 7 |
|
| 8 |
# Copy package files
|
| 9 |
-
COPY package
|
| 10 |
|
| 11 |
# Install dependencies
|
| 12 |
-
RUN
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
-
# Build
|
| 18 |
-
RUN
|
| 19 |
|
|
|
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
| 1 |
+
FROM node:20-alpine
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install Yarn globally
|
| 6 |
+
RUN corepack enable && corepack prepare yarn@stable --activate
|
| 7 |
|
| 8 |
# Copy package files
|
| 9 |
+
COPY package.json yarn.lock ./
|
| 10 |
|
| 11 |
# Install dependencies
|
| 12 |
+
RUN yarn install --frozen-lockfile
|
| 13 |
|
| 14 |
+
# Copy rest of the app
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
+
# Build Next.js
|
| 18 |
+
RUN yarn build
|
| 19 |
|
| 20 |
+
# Expose Hugging Face Spaces default port
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# Start Next.js
|
| 24 |
+
CMD ["yarn", "start", "-p", "7860"]
|