File size: 1,109 Bytes
b2eeb78
 
 
 
de48d1c
 
 
8763d69
 
b2eeb78
de48d1c
 
 
 
 
 
b2eeb78
 
 
8974eaf
 
 
 
 
b2eeb78
 
 
 
 
 
 
8974eaf
 
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
FROM python:3.9-slim

WORKDIR /app

# Create a non-root user
RUN useradd -m -u 1000 user

# Install git, wget, and other utilities
RUN apt-get update &&     apt-get install -y git wget curl tar gzip &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*

# Set ownership for the app directory
RUN mkdir -p /app && chown -R user:user /app

# Switch to the non-root user
USER user

# Clone the repository
RUN git clone https://github.com/Daanworg/cloud-rag-webhook.git /app

# Create data directories
RUN mkdir -p /app/data/chunks /app/data/uploads /app/data/vectors

# Install HF-specific dependencies
RUN pip install --no-cache-dir -U transformers datasets sentence-transformers faiss-cpu gradio torch

# Expose the port the app runs on
EXPOSE 7860

# Set environment variables
ENV PORT=7860

# Command to run the app (we'll use placeholder until we create hf_app.py)
CMD ["python", "-c", "import gradio as gr; demo = gr.Interface(fn=lambda x: f'Setup in progress. Check back soon! {x}', inputs='text', outputs='text', title='RAG Document Processing'); demo.launch(server_name='0.0.0.0', server_port=7860)"]