KeyStone commited on
Commit
1a58a96
·
1 Parent(s): b1a99d1

Add root Dockerfile for Hugging Face Docker Space

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ libmagic1 \
5
+ libmagic-dev \
6
+ libjpeg-dev \
7
+ zlib1g-dev \
8
+ libwebp-dev \
9
+ curl \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ WORKDIR /app
13
+
14
+ COPY backend/requirements.txt ./requirements.txt
15
+ RUN pip install --no-cache-dir --upgrade pip && \
16
+ pip install --no-cache-dir -r requirements.txt
17
+
18
+ COPY backend/ .
19
+
20
+ RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
21
+ USER appuser
22
+
23
+ EXPOSE 7860
24
+
25
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
26
+ CMD curl -f http://localhost:7860/health || exit 1
27
+
28
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]