File size: 830 Bytes
22c6426
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
41
42
43
44
FROM python:3.11-slim

WORKDIR /app

# Install dependencies
RUN apt-get update && apt-get install -y \
    git \
    curl \
    build-essential \
    nodejs \
    npm \
    && rm -rf /var/lib/apt/lists/*

# Clone Open WebUI
RUN git clone https://github.com/open-webui/open-webui.git .

# Install requirements
WORKDIR /app/backend
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir python-dotenv

# Set up frontend
WORKDIR /app
RUN npm install
RUN npm run build

# Set environment variables
ENV ENV=prod
ENV PORT=7860
ENV HOST=0.0.0.0
# HF token will be set via Hugging Face Spaces secrets
ENV WEBUI_AUTH=false

# Create start script
WORKDIR /app/backend
COPY start.sh /app/backend/
RUN chmod +x /app/backend/start.sh

# Expose port
EXPOSE 7860

# Start the application
CMD ["/app/backend/start.sh"]