stopca / Dockerfile
hansaka01's picture
Update Dockerfile
077fdac verified
Raw
History Blame Contribute Delete
668 Bytes
# 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"]