-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (51 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
58 lines (51 loc) · 1.32 KB
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
# Use the official Python image from the Docker Hub
FROM python:3.10-slim
# Set environment variables for non-buffered Python output, GUI compatibility, and OpenGL rendering
ENV PYTHONUNBUFFERED=1 \
QT_QPA_PLATFORM=xcb \
DISPLAY=:0 \
LIBGL_ALWAYS_INDIRECT=1 \
QT_DEBUG_PLUGINS=1
# Install required libraries for Qt, X11, OpenGL, and fonts
RUN apt-get update && apt-get install -y \
libdbus-1-3 \
libxcb-xkb1 \
libx11-xcb1 \
libxcb-util1 \
libxcb-render0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xfixes0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-xinerama0 \
libxcb-glx0 \
libxkbcommon-x11-0 \
libqt5core5a \
libqt5gui5 \
libqt5widgets5 \
libqt5dbus5 \
libqt5xml5 \
x11-apps \
libssl-dev \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxtst6 \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy and install dependencies separately to leverage Docker caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
## Command to run your app
#CMD ["python3", "main.py"]