File size: 4,264 Bytes
d96749f
7b6cf5c
d96749f
7b6cf5c
9fb01a7
7b6cf5c
23ad906
0e8a533
23ad906
7b6cf5c
 
 
 
 
9fb01a7
7b6cf5c
ba7b1d8
 
 
99212f8
 
 
7b6cf5c
 
 
9fb01a7
945dffd
1851742
b0aaa3e
 
9fb01a7
7b6cf5c
9fb01a7
 
7b6cf5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1851742
cbfd821
 
 
 
7b6cf5c
99212f8
fd30a96
03c1850
9fb01a7
 
7b6cf5c
0e8a533
 
7b6cf5c
0e8a533
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178ed12
99212f8
0e8a533
 
 
 
 
178ed12
99212f8
0e8a533
 
 
 
 
 
 
 
 
 
 
 
 
 
7b6cf5c
0e8a533
 
 
 
 
 
 
 
 
 
 
 
7b6cf5c
 
0e8a533
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7b6cf5c
1463aa1
 
7b6cf5c
f9b1dd4
d96749f
f9b1dd4
03c1850
6871b8f
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# ---------------------------------------------------------------------------
# "THE GOD MONOLITH" - V11 (Full Stack: Rust + Chrome + Compilers)
# ---------------------------------------------------------------------------
FROM python:3.11-bookworm

# 1. CRITICAL: Unlock Pip & Non-Interactive
ENV PIP_BREAK_SYSTEM_PACKAGES=1
ENV DEBIAN_FRONTEND=noninteractive

# 2. Install "The Kitchen Sink"
# - cargo/pkg-config/libssl-dev: REQUIRED for AIOStreams (Rust/Crypto)
# - chromium/driver: REQUIRED for FlareSolverr
# - nginx/supervisor: Infrastructure
USER root
RUN apt-get update && apt-get install -y \
    nginx-full \
    build-essential \
    python3-dev \
    libffi-dev \
    libssl-dev \
    cargo \
    pkg-config \
    chromium \
    chromium-driver \
    supervisor \
    curl \
    wget \
    git \
    libicu-dev \
    libsqlite3-0 \
    socat \
    xvfb \
    && rm -rf /var/lib/apt/lists/*

# 3. Environment Variables (Force FlareSolverr to use System Chrome)
ENV CHROME_BIN=/usr/bin/chromium
ENV CHROMIUM_DRIVER=/usr/bin/chromedriver
ENV FLARESOLVERR_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
ENV FLARESOLVERR_BROWSER_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu"
ENV PUID=1000
ENV PGID=1000

# 4. Install FlareSolverr
WORKDIR /app
RUN git clone https://github.com/FlareSolverr/FlareSolverr.git flaresolverr \
    && cd flaresolverr \
    && pip install --no-cache-dir -r requirements.txt

# 5. Install AIOStreams (Now succeeds because 'cargo' is present)
WORKDIR /app
RUN git clone https://github.com/Viren070/AIOStreams.git aiostreams \
    && cd aiostreams \
    && pip install --no-cache-dir -r requirements.txt

# 6. Install Prowlarr
WORKDIR /app
RUN curl -L -o Prowlarr.tar.gz 'https://prowlarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=x64' \
    && tar -xvzf Prowlarr.tar.gz \
    && rm Prowlarr.tar.gz

# 7. Create Directories
RUN mkdir -p /var/log/supervisor /var/lib/nginx/body /var/lib/nginx/fastcgi /var/lib/nginx/proxy /var/lib/nginx/scgi /var/lib/nginx/uwsgi /data/prowlarr /run /etc/nginx /etc/supervisor/conf.d

# 8. NGINX CONFIG
RUN cat <<'EOF' > /etc/nginx/nginx.conf
worker_processes 1;
daemon off;
pid /run/nginx.pid;
events { worker_connections 1024; }
http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    server {
        listen 7860;
        server_name localhost;
        
        # AIOStreams (Main)
        location / {
            proxy_pass http://127.0.0.1:3000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }

        # Prowlarr (Backend)
        location /prowlarr {
            proxy_pass http://127.0.0.1:9696;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
        }
    }
}
EOF

# 9. SUPERVISOR CONFIG
RUN cat <<'EOF' > /etc/supervisor/conf.d/supervisord.conf
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/run/supervisord.pid

[program:nginx]
command=/usr/sbin/nginx
autostart=true
autorestart=true

[program:flaresolverr]
command=python3 /app/flaresolverr/src/flaresolverr.py
directory=/app/flaresolverr
environment=LOG_LEVEL="info",LOG_HTML="false",PORT="8191",HOST="0.0.0.0"
autostart=true
autorestart=true

[program:aiostreams]
command=python3 main.py
directory=/app/aiostreams
environment=PORT="3000",HOST="0.0.0.0"
autostart=true
autorestart=true

[program:prowlarr]
command=/app/Prowlarr/Prowlarr -nobrowser -data=/data/prowlarr
directory=/app/Prowlarr
environment=PROWLARR__GENERAL__URLBASE="/prowlarr"
autostart=true
autorestart=true
EOF

# 10. Fix Permissions
RUN chown -R 1000:1000 /app /data /var/log/supervisor /var/lib/nginx /var/log/nginx /etc/nginx /run /etc/supervisor

# 11. Launch
USER 1000
EXPOSE 7860
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]