Rox-Turbo commited on
Commit
0476ff6
·
verified ·
1 Parent(s): b2c7c75

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -9,15 +9,16 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
 
 
12
  # Copy application code
13
- COPY . .
14
 
15
- # Make startup script executable
16
- RUN chmod +x start.sh
17
 
18
- # Hugging Face Spaces runs as user 1000
19
- RUN useradd -m -u 1000 user
20
- RUN chown -R user:user /app
21
  USER user
22
 
23
  # Set PATH for user
@@ -26,10 +27,6 @@ ENV PATH="/home/user/.local/bin:$PATH"
26
  # Expose port 7860 (Hugging Face Spaces default)
27
  EXPOSE 7860
28
 
29
- # Health check
30
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
31
- CMD python3 -c "import requests; requests.get('http://localhost:7860/health')" || exit 1
32
-
33
  # Start server
34
  CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]
35
 
 
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Create user first
13
+ RUN useradd -m -u 1000 user
14
+
15
  # Copy application code
16
+ COPY --chown=user:user . .
17
 
18
+ # Make startup script executable (if it exists)
19
+ RUN if [ -f start.sh ]; then chmod +x start.sh; fi
20
 
21
+ # Switch to user
 
 
22
  USER user
23
 
24
  # Set PATH for user
 
27
  # Expose port 7860 (Hugging Face Spaces default)
28
  EXPOSE 7860
29
 
 
 
 
 
30
  # Start server
31
  CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]
32