ProfessorCEO commited on
Commit
ac4ef7f
·
verified ·
1 Parent(s): 04b2839

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set up user to avoid permission issues (Required by HF Spaces)
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
+
9
+ WORKDIR $HOME/app
10
+
11
+ # Install system compilers
12
+ USER root
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ cmake \
16
+ git \
17
+ && rm -rf /var/lib/apt/lists/*
18
+ USER user
19
+
20
+ # Install Python packages
21
+ COPY --chown=user requirements.txt requirements.txt
22
+ RUN pip install --no-cache-dir --upgrade pip && \
23
+ pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy the app code
26
+ COPY --chown=user . .
27
+
28
+ # Start the server on port 7860 (Required by HF Spaces)
29
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]