Docker setup
This commit is contained in:
1 parent
65d1092898
commit
67ecf3b8d7
7 files changed
+75
-7
No files matched your search
+45
@@ -0,0 +1,45 @@
|
||||
# Python 3.14 base & pip installation
|
||||
FROM python:3.14 AS base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libgirepository1.0-dev \
|
||||
libcairo2-dev \
|
||||
pkg-config \
|
||||
python3-dev \
|
||||
gtk+3.0 \
|
||||
dbus-x11 \
|
||||
x11vnc \
|
||||
xvfb \
|
||||
fluxbox \
|
||||
net-tools \
|
||||
libappindicator3-dev \
|
||||
libayatana-appindicator3-dev \
|
||||
x11-utils
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Create the final image
|
||||
FROM base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the rest of the project files
|
||||
COPY . .
|
||||
|
||||
# Start Xvfb, Fluxbox, and x11vnc, then run the application
|
||||
CMD rm -f /tmp/.X1-lock && \
|
||||
Xvfb :1 -screen 0 1280x720x16 & \
|
||||
fluxbox & \
|
||||
# Wait for the X server to be up
|
||||
while ! xdpyinfo -display :1 > /dev/null 2>&1; do \
|
||||
echo "Waiting for X server to be available..."; \
|
||||
sleep 1; \
|
||||
done && \
|
||||
echo "X server is running" || (echo "X server failed to start, exiting..." && exit 1); \
|
||||
# Start x11vnc with additional logging
|
||||
x11vnc -display :1 -nopw -listen 0.0.0.0 -forever -xkb -no6 -noxdamage -o /var/log/x11vnc.log & \
|
||||
# Explicitly set the DISPLAY variable for the Python application
|
||||
export DISPLAY=:1 && python main.py 2>&1 | tee /var/log/main.log
|
||||
Reference in new issue
Block a user