File size: 656 Bytes
a2d0320
 
 
e207c78
 
a2d0320
e207c78
 
a2d0320
e207c78
a2d0320
 
 
e207c78
 
 
 
 
 
 
a2d0320
 
 
 
 
 
 
 
 
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
# Use official Bun image
FROM oven/bun:1-alpine AS base

# Set working directory and ensure bun user owns it
WORKDIR /home/bun/app

# Copy package files first for better caching (as root for now)
COPY package.json bun.lockb ./

# Install dependencies as root (to avoid permission issues)
RUN bun install --frozen-lockfile --production

# Copy application files
COPY . .

# Change ownership to bun user (UID 1000 for HF Spaces)
RUN chown -R bun:bun /home/bun/app

# Switch to bun user
USER bun

# Expose port 7860 (Hugging Face Spaces default)
EXPOSE 7860

# Set default port for Hugging Face Spaces
ENV PORT=7860

# Run the server
CMD ["bun", "server.ts"]