Spaces:
Running
Running
File size: 938 Bytes
794cf6c |
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 |
FROM node:20-slim
# Install dependencies as root
RUN apt-get update && apt-get install -y \
curl unzip \
&& rm -rf /var/lib/apt/lists/*
# Use existing node user (UID 1000) for Hugging Face Spaces compatibility
# The node:20-slim image already has a 'node' user with UID 1000
# Install bun globally
RUN curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash
ENV PATH="/usr/local/bin:${PATH}"
# Set working directory with proper permissions
WORKDIR /app
RUN chown -R node:node /app
# Switch to non-root user
USER node
# Copy package files and install dependencies
COPY --chown=node:node package.json bun.lock* ./
RUN bun install
# Copy application files
COPY --chown=node:node . .
# Create writable directory for Vite temp files
RUN mkdir -p /app/.vite && chmod 755 /app/.vite
EXPOSE 7860
ENV NODE_ENV=production
ENV HOME=/home/node
ENTRYPOINT []
CMD ["bun", "run", "dev", "--host", "0.0.0.0", "--port", "7860"]
|