Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
|
@@ -42,15 +42,17 @@ RUN python3.11 -m pip install --no-cache-dir -r requirements.txt
|
|
| 42 |
RUN npm install -g @playwright/mcp@latest
|
| 43 |
|
| 44 |
# Create a non-root user (let system assign UID automatically)
|
| 45 |
-
|
|
|
|
| 46 |
# Copy application code and set ownership
|
| 47 |
COPY . .
|
| 48 |
-
RUN chown -R
|
| 49 |
|
| 50 |
# Make sure the non-root user can access Playwright browsers
|
| 51 |
RUN chmod -R 755 /ms-playwright
|
| 52 |
|
| 53 |
-
# Switch to non-root
|
|
|
|
| 54 |
|
| 55 |
# Set environment variables to use the pre-installed browsers
|
| 56 |
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
@@ -64,4 +66,4 @@ ENV GRADIO_SERVER_NAME=0.0.0.0
|
|
| 64 |
ENV GRADIO_SERVER_PORT=7860
|
| 65 |
|
| 66 |
# Run the application
|
| 67 |
-
CMD ["python", "app.py"]
|
|
|
|
| 42 |
RUN npm install -g @playwright/mcp@latest
|
| 43 |
|
| 44 |
# Create a non-root user (let system assign UID automatically)
|
| 45 |
+
RUN useradd -m appuser
|
| 46 |
+
|
| 47 |
# Copy application code and set ownership
|
| 48 |
COPY . .
|
| 49 |
+
RUN chown -R appuser:appuser /app
|
| 50 |
|
| 51 |
# Make sure the non-root user can access Playwright browsers
|
| 52 |
RUN chmod -R 755 /ms-playwright
|
| 53 |
|
| 54 |
+
# Switch to non-root user
|
| 55 |
+
USER appuser
|
| 56 |
|
| 57 |
# Set environment variables to use the pre-installed browsers
|
| 58 |
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
|
|
| 66 |
ENV GRADIO_SERVER_PORT=7860
|
| 67 |
|
| 68 |
# Run the application
|
| 69 |
+
CMD ["python", "app.py"]
|