sniki28 commited on
Commit
9b50fed
·
verified ·
1 Parent(s): daa31ff

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Content Moderation Queue — OpenEnv
2
+ # Compatible with Hugging Face Spaces (CPU, 2 vCPU, 8 GB RAM)
3
+
4
+ FROM python:3.10-slim
5
+
6
+ # HF Spaces expects the app to run as a non-root user
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
+
12
+ WORKDIR /home/user/app
13
+
14
+ # Install dependencies
15
+ COPY --chown=user requirements.txt .
16
+ RUN pip install --no-cache-dir --upgrade pip \
17
+ && pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy application
20
+ COPY --chown=user . .
21
+
22
+ # Expose port (HF Spaces uses 7860)
23
+ EXPOSE 7860
24
+
25
+ # Health check
26
+ HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
27
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')"
28
+
29
+ # Start server
30
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]