Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +13 -4
Dockerfile
CHANGED
|
@@ -3,20 +3,29 @@
|
|
| 3 |
# SPDX-License-Identifier: Apache-2.0
|
| 4 |
#
|
| 5 |
|
| 6 |
-
# Use
|
| 7 |
FROM hadadrjt/ai:latest
|
| 8 |
|
| 9 |
# Set the main working directory inside the container
|
| 10 |
WORKDIR /node
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Install all dependencies
|
| 16 |
RUN npm install
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
# Open the port so the web can be accessed
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
# Start the server
|
| 22 |
-
CMD ["npm", "start"]
|
|
|
|
| 3 |
# SPDX-License-Identifier: Apache-2.0
|
| 4 |
#
|
| 5 |
|
| 6 |
+
# Use the custom AI base image
|
| 7 |
FROM hadadrjt/ai:latest
|
| 8 |
|
| 9 |
# Set the main working directory inside the container
|
| 10 |
WORKDIR /node
|
| 11 |
|
| 12 |
+
# Install Node.js and npm (using NodeSource repo for latest LTS)
|
| 13 |
+
RUN apt-get update && apt-get install -y curl \
|
| 14 |
+
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
| 15 |
+
&& apt-get install -y nodejs \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Copy package.json and package-lock.json first (for better layer caching)
|
| 19 |
+
COPY package*.json ./
|
| 20 |
|
| 21 |
# Install all dependencies
|
| 22 |
RUN npm install
|
| 23 |
|
| 24 |
+
# Copy the rest of the files
|
| 25 |
+
COPY . .
|
| 26 |
+
|
| 27 |
# Open the port so the web can be accessed
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
# Start the server
|
| 31 |
+
CMD ["npm", "start"]
|