File size: 756 Bytes
a839a45
5f6a15a
 
a839a45
 
 
 
 
 
 
 
 
 
 
 
 
5f6a15a
 
 
 
a839a45
5f6a15a
 
a839a45
5f6a15a
 
a839a45
5f6a15a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Use the official Playwright image
FROM mcr.microsoft.com/playwright:v1.45.0-jammy

# Switch to root to fix the user conflict
USER root

# Rename the existing 'pwuser' (UID 1000) to 'user' and update its home directory
RUN usermod -l user pwuser && \
    usermod -d /home/user -m user && \
    groupmod -n user pwuser

# Set permissions for the app directory
WORKDIR /home/user/app
RUN chown -R user:user /home/user/app

# Switch to the renamed user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Install Chromium (Playwright needs this)
RUN npx playwright install chromium

# Hugging Face default port
EXPOSE 7860

# Start the server
CMD ["npx", "playwright", "run-server", "--port", "7860", "--host", "0.0.0.0", "--path", "/ws"]