Spaces:
Sleeping
Sleeping
| # Gunakan Python base image dengan Debian | |
| FROM python:3.11-slim AS base | |
| # Install curl, build tools, dan Node.js 18 (LTS) | |
| RUN apt-get update && \ | |
| apt-get install -y curl gnupg build-essential && \ | |
| curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy dan install dependencies Node.js | |
| COPY package*.json ./ | |
| RUN npm install | |
| # Copy semua file project ke container | |
| COPY . . | |
| # Install dependencies Python | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Build Next.js app | |
| RUN npm run build | |
| # Fix permissions for .next directory | |
| RUN mkdir -p /app/.next/cache && \ | |
| chown -R 1000:1000 /app/.next | |
| # Port for HF Spaces | |
| EXPOSE 7860 | |
| # Start in production mode and bind to 0.0.0.0:7860 | |
| CMD ["npm", "start"] | |
| # Dockerfile Lama | |
| # Node image | |
| # FROM node:22.2-alpine | |
| # # Set workdir | |
| # WORKDIR /app | |
| # COPY package*.json ./ | |
| # # Install dependencies | |
| # RUN npm install | |
| # COPY . . | |
| # # Build app | |
| # RUN npm run build | |
| # EXPOSE 3000 | |
| # # Start app | |
| # CMD ["npm", "start"] | |