Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Step 1: Use an official Node.js runtime as the base image
|
| 2 |
+
FROM node:20-slim
|
| 3 |
+
|
| 4 |
+
# Install git so we can clone the private/public repo
|
| 5 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 6 |
+
|
| 7 |
+
# Set the working directory inside the container
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
# Declare the build argument for your Hugging Face Secret
|
| 11 |
+
# (Make sure the Secret name in HF matches 'GIT_REPO_URL')
|
| 12 |
+
ARG GIT_REPO_URL
|
| 13 |
+
|
| 14 |
+
# Clone the repository into the current directory (.)
|
| 15 |
+
# Using a shallow clone (--depth 1) keeps the image size smaller
|
| 16 |
+
RUN git clone ${GIT_REPO_URL} .
|
| 17 |
+
|
| 18 |
+
# Install project dependencies
|
| 19 |
+
RUN npm ci --only=production
|
| 20 |
+
|
| 21 |
+
# Expose the port your app runs on (Hugging Face usually expects 7860)
|
| 22 |
+
EXPOSE 7860
|
| 23 |
+
ENV PORT=7860
|
| 24 |
+
|
| 25 |
+
# Start the application
|
| 26 |
+
CMD ["npm", "start"]
|