next-site / Dockerfile
adowu's picture
Deploy from GitHub via GH -> HF Deployer
0792ac1 verified
Raw
History Blame Contribute Delete
831 Bytes
# Auto-generated by GH -> HF Spaces Deployer
FROM node:20-slim
ENV NODE_ENV=production \
PORT=7860 \
HOST=0.0.0.0
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*
# Clone the source repository at build time.
RUN git clone --depth 1 --branch master https://github.com/sanyaade-iot/next-site.git /app
# Install dependencies (uses lockfile when present).
RUN if [ -f package-lock.json ]; then npm ci --omit=dev || npm install --omit=dev; \
elif [ -f yarn.lock ]; then corepack enable && yarn install --production; \
elif [ -f pnpm-lock.yaml ]; then corepack enable && pnpm install --prod; \
else npm install --omit=dev; fi
# Build step if a build script exists.
RUN npm run build --if-present
EXPOSE 7860
CMD ["npm", "start"]