subhdotsol commited on
Commit
6717b72
·
1 Parent(s): ed3f0c3

feat : dockerfile added for build

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -5
Dockerfile CHANGED
@@ -7,18 +7,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Python deps first (cached layer)
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy source
15
  COPY . .
16
 
17
- # Non-root user (HuggingFace Spaces requirement)
18
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
19
  USER appuser
20
 
21
- # HuggingFace Spaces uses port 7860
22
  EXPOSE 7860
23
 
24
- CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Python deps (cached layer)
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Copy source code
15
  COPY . .
16
 
17
+ # Non-root user for security
18
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
19
  USER appuser
20
 
21
+ # Expose port if needed (for server apps)
22
  EXPOSE 7860
23
 
24
+ # Default command: run your inference
25
+ CMD ["python", "inference.py"]
26
+
27
+