File size: 668 Bytes
96f023b
 
 
2fd5e3a
96f023b
 
 
 
 
2fd5e3a
 
 
 
96f023b
 
077fdac
 
96f023b
2fd5e3a
96f023b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Step 1: Use an official Node.js runtime as the base image
FROM node:20-slim

# Install git so we can clone the repo
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container
WORKDIR /app

# --- THE FIX IS HERE ---
# Mount the Hugging Face secret safely during the build layer
RUN --mount=type=secret,id=GIT_REPO_URL,mode=0444,required=true \
    git clone $(cat /run/secrets/GIT_REPO_URL) .

# Install project dependencies
# Replace the old npm ci line with this:
RUN npm install --omit=dev

# Expose the port your app runs on
EXPOSE 7860
ENV PORT=7860

# Start the application
CMD ["npm", "start"]