File size: 3,138 Bytes
37e1d82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Use Ubuntu 22.04 as base
FROM ubuntu:22.04

# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies
RUN apt-get update && apt-get install -y \
    # X11 and VNC essentials
    xvfb \
    x11vnc \
    fluxbox \
    x11-utils \
    xdpyinfo \
    # NoVNC for web access
    novnc \
    websockify \
    # Chromium/Electron dependencies
    libnss3 \
    libnspr4 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libdbus-1-3 \
    libxkbcommon0 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxrandr2 \
    libgbm1 \
    libgtk-3-0 \
    libpango-1.0-0 \
    libcairo2 \
    libasound2 \
    libatspi2.0-0 \
    libxshmfence1 \
    # Additional libraries
    libglib2.0-0 \
    libx11-6 \
    libx11-xcb1 \
    libxcb1 \
    libxext6 \
    libxi6 \
    libxtst6 \
    libxss1 \
    libgdk-pixbuf2.0-0 \
    libnotify4 \
    libsecret-1-0 \
    # Utilities
    wget \
    curl \
    ca-certificates \
    python3 \
    python3-pip \
    psmisc \
    net-tools \
    procps \
    --no-install-recommends && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install ngrok
RUN wget -q https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && \
    tar -xzf ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin/ && \
    rm ngrok-v3-stable-linux-amd64.tgz && \
    chmod +x /usr/local/bin/ngrok

# Create app directory
WORKDIR /app

# Copy Python requirements and install
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# Create OrganicHits directory structure
RUN mkdir -p OrganicHits/locales OrganicHits/resources

# Copy all OrganicHits files (matching the .deb structure)
COPY organichits-exchanger OrganicHits/
COPY icudtl.dat OrganicHits/
COPY v8_context_snapshot.bin OrganicHits/
COPY snapshot_blob.bin OrganicHits/
COPY resources.pak OrganicHits/
COPY chrome_100_percent.pak OrganicHits/
COPY chrome_200_percent.pak OrganicHits/
COPY libffmpeg.so OrganicHits/
COPY libGLESv2.so OrganicHits/
COPY libEGL.so OrganicHits/
COPY libvulkan.so.1 OrganicHits/
COPY libvk_swiftshader.so OrganicHits/
COPY vk_swiftshader_icd.json OrganicHits/
COPY chrome-sandbox OrganicHits/
COPY chrome_crashpad_handler OrganicHits/

# Copy locales folder
COPY locales/ OrganicHits/locales/

# Copy resources folder
COPY resources/ OrganicHits/resources/

# Make executables executable
RUN chmod +x OrganicHits/organichits-exchanger \
    OrganicHits/chrome-sandbox \
    OrganicHits/chrome_crashpad_handler

# Create VNC and Fluxbox directories
RUN mkdir -p /root/.vnc /root/.fluxbox

# Configure Fluxbox (simple, minimal window manager config)
RUN echo "session.screen0.toolbar.visible: false" > /root/.fluxbox/init && \
    echo "session.screen0.workspaces: 1" >> /root/.fluxbox/init

# Copy Python application
COPY app.py .

# Expose ports
# 7860: Gradio interface
# 5901: VNC server
# 8081: Websockify/NoVNC
EXPOSE 7860 5901 8081

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
    CMD curl -f http://localhost:7860/ || exit 1

# Start the application
CMD ["python3", "app.py"]