File size: 768 Bytes
1f9c201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM mcr.microsoft.com/playwright:v1.47.0-noble

RUN apt-get update -q && apt-get install -qy python3 python3-pip

# Switch to the "ubuntu" user
USER ubuntu

# Set home to the ubuntu's home directory
ENV HOME=/home/ubuntu \
	PATH=/home/ubuntu/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
COPY --chown=ubuntu requirements.txt $HOME/app
RUN pip install --no-cache-dir --upgrade -r requirements.txt --break-system-packages

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=ubuntu app.py $HOME/app

EXPOSE 7860

ENTRYPOINT [ "python3" ]
CMD [ "app.py" ]