huijio commited on
Commit
37e1d82
·
verified ·
1 Parent(s): fbe70cb

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +128 -0
Dockerfile ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Create OrganicHits directory structure
77
+ RUN mkdir -p OrganicHits/locales OrganicHits/resources
78
+
79
+ # Copy all OrganicHits files (matching the .deb structure)
80
+ COPY organichits-exchanger OrganicHits/
81
+ COPY icudtl.dat OrganicHits/
82
+ COPY v8_context_snapshot.bin OrganicHits/
83
+ COPY snapshot_blob.bin OrganicHits/
84
+ COPY resources.pak OrganicHits/
85
+ COPY chrome_100_percent.pak OrganicHits/
86
+ COPY chrome_200_percent.pak OrganicHits/
87
+ COPY libffmpeg.so OrganicHits/
88
+ COPY libGLESv2.so OrganicHits/
89
+ COPY libEGL.so OrganicHits/
90
+ COPY libvulkan.so.1 OrganicHits/
91
+ COPY libvk_swiftshader.so OrganicHits/
92
+ COPY vk_swiftshader_icd.json OrganicHits/
93
+ COPY chrome-sandbox OrganicHits/
94
+ COPY chrome_crashpad_handler OrganicHits/
95
+
96
+ # Copy locales folder
97
+ COPY locales/ OrganicHits/locales/
98
+
99
+ # Copy resources folder
100
+ COPY resources/ OrganicHits/resources/
101
+
102
+ # Make executables executable
103
+ RUN chmod +x OrganicHits/organichits-exchanger \
104
+ OrganicHits/chrome-sandbox \
105
+ OrganicHits/chrome_crashpad_handler
106
+
107
+ # Create VNC and Fluxbox directories
108
+ RUN mkdir -p /root/.vnc /root/.fluxbox
109
+
110
+ # Configure Fluxbox (simple, minimal window manager config)
111
+ RUN echo "session.screen0.toolbar.visible: false" > /root/.fluxbox/init && \
112
+ echo "session.screen0.workspaces: 1" >> /root/.fluxbox/init
113
+
114
+ # Copy Python application
115
+ COPY app.py .
116
+
117
+ # Expose ports
118
+ # 7860: Gradio interface
119
+ # 5901: VNC server
120
+ # 8081: Websockify/NoVNC
121
+ EXPOSE 7860 5901 8081
122
+
123
+ # Health check
124
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
125
+ CMD curl -f http://localhost:7860/ || exit 1
126
+
127
+ # Start the application
128
+ CMD ["python3", "app.py"]