indonesian / Dockerfile
devusman's picture
update
2d9fcfd
raw
history blame
1.11 kB
# Use a stable and small Node.js image
FROM node:18-alpine
# Install Git and Git LFS, which are required to clone from the Hugging Face Hub
RUN apk add --no-cache git git-lfs
# Set the working directory inside the container
WORKDIR /app
# Initialize Git LFS in the container environment
RUN git lfs install
# --- IMPORTANT STEP ---
# Clone your 'waliyan' dataset and place its contents into a local 'data' folder.
# The "--depth 1" flag makes the download faster by only getting the latest version.
RUN git clone --depth 1 https://huggingface.co/datasets/devusman/waliyan data
# Copy package files and install dependencies first to leverage Docker's layer caching
COPY package.json package-lock.json* ./
# Use 'npm ci' for reproducible builds in production environments
RUN npm i
# Copy the rest of your application code (index.js, views/, etc.)
COPY . .
# Expose the port that Hugging Face Spaces expects.
# The platform will detect this and route traffic accordingly.
EXPOSE 7860
# The command to start your Express server
# Your code will now find the 'data' folder at /app/data
CMD ["node", "index.js"]