Update Dockerfile
Browse files- Dockerfile +6 -9
Dockerfile
CHANGED
|
@@ -1,24 +1,21 @@
|
|
| 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
|
| 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 |
-
#
|
| 11 |
-
#
|
| 12 |
-
|
| 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
|
| 22 |
EXPOSE 7860
|
| 23 |
ENV PORT=7860
|
| 24 |
|
|
|
|
| 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 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 |
+
# --- THE FIX IS HERE ---
|
| 11 |
+
# Mount the Hugging Face secret safely during the build layer
|
| 12 |
+
RUN --mount=type=secret,id=GIT_REPO_URL,mode=0444,required=true \
|
| 13 |
+
git clone $(cat /run/secrets/GIT_REPO_URL) .
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Install project dependencies
|
| 16 |
RUN npm ci --only=production
|
| 17 |
|
| 18 |
+
# Expose the port your app runs on
|
| 19 |
EXPOSE 7860
|
| 20 |
ENV PORT=7860
|
| 21 |
|