riazmo commited on
Commit
67ae0a7
·
verified ·
1 Parent(s): 9f5ee50

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -36,22 +36,30 @@ COPY requirements.txt .
36
  # Install Python dependencies
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
39
- # Install Playwright browsers
40
- RUN playwright install chromium
41
  RUN playwright install-deps chromium
42
 
 
 
 
43
  # Copy application code
44
  COPY . .
45
 
46
- # Create non-root user for security
47
- RUN useradd -m -u 1000 user
 
 
48
  USER user
49
 
50
  # Set environment variables
51
  ENV HOME=/home/user \
52
  PATH=/home/user/.local/bin:$PATH \
53
  GRADIO_SERVER_NAME=0.0.0.0 \
54
- GRADIO_SERVER_PORT=7860
 
 
 
 
55
 
56
  # Expose port
57
  EXPOSE 7860
 
36
  # Install Python dependencies
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
39
+ # Install Playwright system dependencies
 
40
  RUN playwright install-deps chromium
41
 
42
+ # Create non-root user
43
+ RUN useradd -m -u 1000 user
44
+
45
  # Copy application code
46
  COPY . .
47
 
48
+ # Change ownership to user
49
+ RUN chown -R user:user /app
50
+
51
+ # Switch to user
52
  USER user
53
 
54
  # Set environment variables
55
  ENV HOME=/home/user \
56
  PATH=/home/user/.local/bin:$PATH \
57
  GRADIO_SERVER_NAME=0.0.0.0 \
58
+ GRADIO_SERVER_PORT=7860 \
59
+ PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
60
+
61
+ # Install Playwright browsers as user
62
+ RUN playwright install chromium
63
 
64
  # Expose port
65
  EXPOSE 7860