Spaces:
Sleeping
Sleeping
File size: 945 Bytes
83a5327 58f620d 83a5327 58f620d 83a5327 58f620d 83a5327 2b1d051 58f620d 83a5327 58f620d 83a5327 58f620d 83a5327 58f620d 83a5327 7a0b2ce 83a5327 7a0b2ce 83a5327 58f620d 83a5327 58f620d 83a5327 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Gunakan Node.js versi 22 berbasis Debian Bullseye
FROM node:22-bullseye
# Update dan install Git
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Set workdir ke /app
WORKDIR /app
# Tambahkan ARG untuk GitHub Repository
RUN --mount=type=secret,id=GITHUB_REPO,required=true \
git clone $(cat /run/secrets/GITHUB_REPO) myrepo
# Masuk ke dalam folder repo
WORKDIR /app/myrepo
# Copy package.json dan package-lock.json untuk install dependensi lebih efisien
COPY package*.json ./
# Install dependensi
RUN npm install
# Copy semua file ke dalam container
COPY . .
# Buat folder public di /tmp agar bisa ditulis di Hugging Face
RUN mkdir -p /tmp/public && chmod -R 777 /tmp/public
# Tampilkan isi folder untuk debugging
RUN ls -lah
# Expose port 7860 (sesuai dengan Hugging Face Spaces)
EXPOSE 7860
# Jalankan aplikasi
CMD ["npm", "run", "start"]
|