LumaKit / Dockerfile
YoruAkio's picture
fix: update exposed port to 7860 and adjust environment variable in Dockerfile and index.js
f26d3fa
raw
history blame
868 Bytes
# Use Bun's official Alpine image
FROM oven/bun:1.1-alpine as base
# Set working directory
WORKDIR /app
# Create a non-root user for security
RUN addgroup -g 1001 -S nodejs
RUN adduser -S lumakit -u 1001
# Copy package files
COPY package.json bun.lockb* ./
# Install dependencies
RUN bun install --frozen-lockfile --production
# Copy source code
COPY --chown=lumakit:nodejs src/ ./src/
# Create necessary directories and set permissions
RUN mkdir -p /app/logs /app/temp && \
chown -R lumakit:nodejs /app
# Switch to non-root user
USER lumakit
# Expose port 7860 (Hugging Face Spaces standard port)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD bun --version || exit 1
# Set environment variables
ENV NODE_ENV=production
ENV PORT=7860
# Start the application
CMD ["bun", "run", "src/index.js"]