huijio commited on
Commit
6324bb1
·
verified ·
1 Parent(s): 33f0595

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +62 -53
Dockerfile CHANGED
@@ -1,95 +1,104 @@
1
- # Use an Ubuntu base image
2
  FROM ubuntu:22.04
3
 
4
- # Set environment variables to non-interactive
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
- # Install all dependencies
8
  RUN apt-get update && apt-get install -y \
9
- tigervnc-standalone-server \
 
 
10
  fluxbox \
11
- websockify \
 
 
12
  novnc \
13
- python3 \
14
- python3-pip \
15
- psmisc \
16
  libnss3 \
17
- libglib2.0-0 \
18
  libatk1.0-0 \
19
  libatk-bridge2.0-0 \
20
  libcups2 \
21
  libdrm2 \
22
- libgtk-3-0 \
23
- libxss1 \
24
  libxcomposite1 \
25
- libxrandr2 \
26
  libxdamage1 \
27
- libxext6 \
28
  libxfixes3 \
29
- libxi6 \
30
- libxtst6 \
 
31
  libpango-1.0-0 \
32
  libcairo2 \
 
 
 
 
 
33
  libx11-6 \
34
- libxkbcommon0 \
35
  libx11-xcb1 \
36
  libxcb1 \
37
- libxcb-dri3-0 \
38
- libxshmfence1 \
 
 
39
  libgdk-pixbuf2.0-0 \
40
- libfreetype6 \
41
- libfontconfig1 \
42
- libpci3 \
43
- libasound2 \
44
- libatspi2.0-0 \
45
- libgbm1 \
46
- libwayland-client0 \
47
- libwayland-server0 \
48
- xvfb \
49
- net-tools \
50
  wget \
51
  curl \
52
- netcat-openbsd \
 
 
 
 
53
  procps \
54
  --no-install-recommends && \
55
  apt-get clean && \
56
  rm -rf /var/lib/apt/lists/*
57
 
58
- # Install ngrok (using the working method)
59
- RUN wget -q https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz -O ngrok.tgz && \
60
- tar -xzf ngrok.tgz -C /usr/local/bin/ && \
61
- rm ngrok.tgz && \
62
  chmod +x /usr/local/bin/ngrok
63
 
64
- # Install Python packages
 
 
 
65
  COPY requirements.txt .
66
  RUN pip3 install --no-cache-dir -r requirements.txt
67
 
68
- # Create application directory
69
- RUN mkdir -p /opt/OrganicHits
 
70
 
71
- # Copy the application and library
72
- COPY organichits-exchanger /opt/OrganicHits/organichits-exchanger
73
- COPY libffmpeg.so /opt/OrganicHits/libffmpeg.so
74
 
75
- # Make the application executable
76
- RUN chmod +x /opt/OrganicHits/organichits-exchanger
77
 
78
- # Create necessary directories
79
- RUN mkdir -p /root/.vnc && \
80
- mkdir -p /root/.fluxbox && \
81
- echo "session.screen0.toolbar.visible: false" > /root/.fluxbox/init
82
 
83
- # Create fluxbox menu
84
- RUN echo '[begin] (fluxbox)' > /root/.fluxbox/menu && \
85
- echo '[exec] (OrganicHits) {/opt/OrganicHits/organichits-exchanger --no-sandbox --disable-dev-shm-usage}' >> /root/.fluxbox/menu && \
86
- echo '[end]' >> /root/.fluxbox/menu
87
-
88
- # Copy the application code
89
  COPY app.py .
90
 
91
- # Expose the necessary ports
 
 
 
92
  EXPOSE 7860 5901 8081
93
 
94
- # Set the entrypoint
 
 
 
 
95
  CMD ["python3", "app.py"]
 
1
+ # Use Ubuntu 22.04 as base
2
  FROM ubuntu:22.04
3
 
4
+ # Prevent interactive prompts
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
+ # X11 and VNC essentials
10
+ xvfb \
11
+ x11vnc \
12
  fluxbox \
13
+ x11-utils \
14
+ xdpyinfo \
15
+ # NoVNC for web access
16
  novnc \
17
+ websockify \
18
+ # Chromium/Electron dependencies
 
19
  libnss3 \
20
+ libnspr4 \
21
  libatk1.0-0 \
22
  libatk-bridge2.0-0 \
23
  libcups2 \
24
  libdrm2 \
25
+ libdbus-1-3 \
26
+ libxkbcommon0 \
27
  libxcomposite1 \
 
28
  libxdamage1 \
 
29
  libxfixes3 \
30
+ libxrandr2 \
31
+ libgbm1 \
32
+ libgtk-3-0 \
33
  libpango-1.0-0 \
34
  libcairo2 \
35
+ libasound2 \
36
+ libatspi2.0-0 \
37
+ libxshmfence1 \
38
+ # Additional libraries
39
+ libglib2.0-0 \
40
  libx11-6 \
 
41
  libx11-xcb1 \
42
  libxcb1 \
43
+ libxext6 \
44
+ libxi6 \
45
+ libxtst6 \
46
+ libxss1 \
47
  libgdk-pixbuf2.0-0 \
48
+ libnotify4 \
49
+ libsecret-1-0 \
50
+ # Utilities
 
 
 
 
 
 
 
51
  wget \
52
  curl \
53
+ ca-certificates \
54
+ python3 \
55
+ python3-pip \
56
+ psmisc \
57
+ net-tools \
58
  procps \
59
  --no-install-recommends && \
60
  apt-get clean && \
61
  rm -rf /var/lib/apt/lists/*
62
 
63
+ # Install ngrok
64
+ RUN wget -q https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && \
65
+ tar -xzf ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin/ && \
66
+ rm ngrok-v3-stable-linux-amd64.tgz && \
67
  chmod +x /usr/local/bin/ngrok
68
 
69
+ # Create app directory
70
+ WORKDIR /app
71
+
72
+ # Copy Python requirements and install
73
  COPY requirements.txt .
74
  RUN pip3 install --no-cache-dir -r requirements.txt
75
 
76
+ # Copy application binary and library
77
+ COPY organichits-exchanger .
78
+ COPY libffmpeg.so .
79
 
80
+ # Make binary executable
81
+ RUN chmod +x organichits-exchanger
 
82
 
83
+ # Create VNC and Fluxbox directories
84
+ RUN mkdir -p /root/.vnc /root/.fluxbox
85
 
86
+ # Configure Fluxbox (simple, minimal window manager config)
87
+ RUN echo "session.screen0.toolbar.visible: false" > /root/.fluxbox/init && \
88
+ echo "session.screen0.workspaces: 1" >> /root/.fluxbox/init
 
89
 
90
+ # Copy Python application
 
 
 
 
 
91
  COPY app.py .
92
 
93
+ # Expose ports
94
+ # 7860: Gradio interface
95
+ # 5901: VNC server
96
+ # 8081: Websockify/NoVNC
97
  EXPOSE 7860 5901 8081
98
 
99
+ # Health check
100
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
101
+ CMD curl -f http://localhost:7860/ || exit 1
102
+
103
+ # Start the application
104
  CMD ["python3", "app.py"]