James Frecheville
commited on
Commit
·
4346c22
1
Parent(s):
f7954c5
Fix Playwright permissions and Gradio scale warning
Browse files- Dockerfile +11 -7
- owl/webapp.py +1 -1
Dockerfile
CHANGED
@@ -44,16 +44,23 @@ RUN apt-get update && apt-get install -y \
|
|
44 |
# Set working directory
|
45 |
WORKDIR /app
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
# Copy requirements and install Python dependencies
|
48 |
COPY requirements.txt .
|
49 |
RUN pip install --no-cache-dir -r requirements.txt
|
50 |
|
51 |
-
# Install Playwright browsers and dependencies
|
52 |
-
RUN playwright install chromium
|
53 |
-
|
|
|
54 |
|
55 |
# Copy the rest of the application
|
56 |
COPY . .
|
|
|
57 |
|
58 |
# Set environment variables
|
59 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
@@ -62,10 +69,7 @@ ENV GRADIO_ANALYTICS_ENABLED=false
|
|
62 |
ENV GRADIO_ALLOW_FLAGGING=false
|
63 |
ENV GRADIO_QUEUE_ENABLED=false
|
64 |
ENV DISPLAY=:99
|
65 |
-
|
66 |
-
# Create a non-root user
|
67 |
-
RUN useradd -m -u 1000 user && \
|
68 |
-
chown -R user:user /app
|
69 |
|
70 |
# Switch to non-root user
|
71 |
USER user
|
|
|
44 |
# Set working directory
|
45 |
WORKDIR /app
|
46 |
|
47 |
+
# Create a non-root user
|
48 |
+
RUN useradd -m -u 1000 user && \
|
49 |
+
mkdir -p /home/user/.cache && \
|
50 |
+
chown -R user:user /home/user/.cache
|
51 |
+
|
52 |
# Copy requirements and install Python dependencies
|
53 |
COPY requirements.txt .
|
54 |
RUN pip install --no-cache-dir -r requirements.txt
|
55 |
|
56 |
+
# Install Playwright browsers and dependencies as root
|
57 |
+
RUN playwright install chromium && \
|
58 |
+
playwright install-deps && \
|
59 |
+
chown -R user:user /root/.cache/ms-playwright
|
60 |
|
61 |
# Copy the rest of the application
|
62 |
COPY . .
|
63 |
+
RUN chown -R user:user /app
|
64 |
|
65 |
# Set environment variables
|
66 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
|
|
69 |
ENV GRADIO_ALLOW_FLAGGING=false
|
70 |
ENV GRADIO_QUEUE_ENABLED=false
|
71 |
ENV DISPLAY=:99
|
72 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
|
|
|
|
|
|
|
73 |
|
74 |
# Switch to non-root user
|
75 |
USER user
|
owl/webapp.py
CHANGED
@@ -1171,7 +1171,7 @@ def create_ui():
|
|
1171 |
# Main content divided into two-column layout
|
1172 |
with gr.Row():
|
1173 |
# Left column: Environment variable management controls
|
1174 |
-
with gr.Column(scale=
|
1175 |
with gr.Column(elem_classes="env-controls"):
|
1176 |
# Environment variable table - set to interactive for direct editing
|
1177 |
gr.Markdown("""
|
|
|
1171 |
# Main content divided into two-column layout
|
1172 |
with gr.Row():
|
1173 |
# Left column: Environment variable management controls
|
1174 |
+
with gr.Column(scale=1):
|
1175 |
with gr.Column(elem_classes="env-controls"):
|
1176 |
# Environment variable table - set to interactive for direct editing
|
1177 |
gr.Markdown("""
|