1MR commited on
Commit
2f5c577
·
verified ·
1 Parent(s): 1a41e74

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1
6
+ ENV PIP_NO_CACHE_DIR=1
7
+
8
+ # Set work directory
9
+ WORKDIR /code
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Copy requirements and install
17
+ COPY requirements.txt ./
18
+ RUN pip install --upgrade pip && pip install -r requirements.txt
19
+
20
+ # Copy the rest of the code
21
+ COPY . .
22
+
23
+ # Expose port for Uvicorn
24
+ EXPOSE 7860
25
+
26
+ # Hugging Face Spaces expects the app to run on 0.0.0.0:7860
27
+ CMD ["uvicorn", "ROBO:app", "--host", "0.0.0.0", "--port", "7860"]