forked from wodsuz/EasyApplyJobsBot
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile-vnc
57 lines (43 loc) · 1.5 KB
/
Dockerfile-vnc
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
FROM python:3.12
# Install dependencies for VNC
RUN apt-get update && apt-get install -y \
xvfb \
x11vnc \
fluxbox \
wget \
wmctrl
# ... other dependencies you might need
# Set up VNC server
RUN mkdir ~/.vnc
RUN x11vnc -storepasswd yourpassword ~/.vnc/passwd
# Set display environment variable
ENV DISPLAY=:99
# Expose VNC port
EXPOSE 5901
ENV PYTHONUNBUFFERED=1
# Define where Chrome will store its user data
ENV CHROME_USER_DATA_DIR=/home/user/chrome_data
RUN apt-get install -y chromium-driver chromium
# Create symbolic links for the expected Google Chrome names to the Chromium executable
RUN ln -s /usr/bin/chromium /usr/bin/google-chrome && \
ln -s /usr/bin/chromium /usr/bin/google-chrome-stable && \
ln -s /usr/bin/chromium /usr/bin/google-chrome-beta && \
ln -s /usr/bin/chromium /usr/bin/google-chrome-dev
# Copy the requirements file and install Python dependencies
COPY ./requirements.txt /requirements.txt
RUN pip install --upgrade pip && pip install -r /requirements.txt
# Create a directory for your application and set permissions
RUN mkdir /app && chmod -R 777 /app
# Copy the application files
COPY . /app
# Set read/write permissions for the data directory
RUN chmod -R 777 /app/data
# Set the working directory
WORKDIR /app
# Use an unprivileged user to run the app
# RUN adduser --disabled-password --gecos "" user
# USER user
CMD Xvfb :99 -screen 0 1024x768x16 & \
fluxbox & \
x11vnc -display :99 -N -forever -usepw & \
python3 allConfigsRunner.py .