-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (71 loc) · 1.77 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM ubuntu:22.04
# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies and Python 3.11
RUN apt-get update && apt-get install -y \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y \
python3.11 \
python3.11-venv \
python3.11-dev \
python3-pip \
curl \
xvfb \
x11vnc \
fluxbox \
novnc \
# Dependencies for Chrome/Playwright
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
# Additional Playwright dependencies
libpango-1.0-0 \
libpangocairo-1.0-0 \
libcairo2 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libglib2.0-0 \
libnss3-dev \
libcups2-dev \
libxss1 \
libxrandr2 \
libxtst6 \
fonts-liberation \
fonts-noto-color-emoji \
fonts-dejavu-core \
fontconfig \
xdg-utils \
libatspi2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
ENV POETRY_HOME=/opt/poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${POETRY_HOME}/bin:$PATH"
RUN poetry config virtualenvs.create false
WORKDIR /app
COPY pyproject.toml poetry.lock* ./
RUN poetry install --no-root --only main
# Update font cache
RUN fc-cache -f -v
RUN poetry run playwright install --with-deps chromium
COPY api.py .
COPY index.html .
COPY start.sh .
RUN chmod +x start.sh
# Set up VNC password
RUN mkdir ~/.vnc && x11vnc -storepasswd password ~/.vnc/passwd
EXPOSE 8000
EXPOSE 6080
ENTRYPOINT ["./start.sh"]