void0028 commited on
Commit
0e8a533
·
verified ·
1 Parent(s): 6de48ff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +78 -75
Dockerfile CHANGED
@@ -1,12 +1,13 @@
1
  # ---------------------------------------------------------------------------
2
- # "THE GOD MONOLITH" - V5 (Fixed Quoting & Paths)
3
  # ---------------------------------------------------------------------------
4
  FROM python:3.11-bookworm
5
 
6
- # 1. Unlock Pip
7
  ENV PIP_BREAK_SYSTEM_PACKAGES=1
 
8
 
9
- # 2. Install System Dependencies
10
  USER root
11
  RUN apt-get update && apt-get install -y \
12
  nginx-full \
@@ -21,6 +22,7 @@ RUN apt-get update && apt-get install -y \
21
  libicu-dev \
22
  libssl-dev \
23
  libsqlite3-0 \
 
24
  socat \
25
  xvfb \
26
  && rm -rf /var/lib/apt/lists/*
@@ -51,78 +53,79 @@ RUN curl -L -o Prowlarr.tar.gz 'https://prowlarr.servarr.com/v1/update/master/up
51
  && rm Prowlarr.tar.gz
52
 
53
  # 5. Create Directories
54
- RUN mkdir -p /var/log/supervisor /var/lib/nginx/body /var/lib/nginx/fastcgi /data/prowlarr /run /etc/nginx /etc/supervisor/conf.d
55
-
56
- # 6. GENERATE NGINX CONFIG (Safe Single-Quote Method)
57
- # We use single quotes for the outer RUN command so the shell ignores the $ signs inside.
58
- RUN python3 -c 'import os; \
59
- nginx_conf = """worker_processes 1; \
60
- daemon off; \
61
- pid /run/nginx.pid; \
62
- events { worker_connections 1024; } \
63
- http { \
64
- include mime.types; \
65
- default_type application/octet-stream; \
66
- sendfile on; \
67
- keepalive_timeout 65; \
68
- server { \
69
- listen 7860; \
70
- server_name localhost; \
71
- location / { \
72
- proxy_pass http://127.0.0.1:3000; \
73
- proxy_set_header Host $host; \
74
- proxy_set_header X-Real-IP $remote_addr; \
75
- } \
76
- location /prowlarr { \
77
- proxy_pass http://127.0.0.1:9696; \
78
- proxy_set_header Host $host; \
79
- proxy_set_header X-Real-IP $remote_addr; \
80
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \
81
- proxy_set_header X-Forwarded-Proto $scheme; \
82
- proxy_http_version 1.1; \
83
- proxy_set_header Upgrade $http_upgrade; \
84
- proxy_set_header Connection "Upgrade"; \
85
- } \
86
- } \
87
- }"""; \
88
- with open("/etc/nginx/nginx.conf", "w") as f: f.write(nginx_conf)'
89
-
90
- # 7. GENERATE SUPERVISOR CONFIG (Safe Single-Quote Method)
91
- RUN python3 -c 'import os; \
92
- super_conf = """[supervisord] \
93
- nodaemon=true \
94
- logfile=/var/log/supervisor/supervisord.log \
95
- pidfile=/run/supervisord.pid \
96
- \
97
- [program:nginx] \
98
- command=/usr/sbin/nginx \
99
- autostart=true \
100
- autorestart=true \
101
- \
102
- [program:flaresolverr] \
103
- command=python3 /app/flaresolverr/src/flaresolverr.py \
104
- directory=/app/flaresolverr \
105
- environment=LOG_LEVEL="info",LOG_HTML="false",PORT="8191",HOST="0.0.0.0" \
106
- autostart=true \
107
- autorestart=true \
108
- \
109
- [program:aiostreams] \
110
- command=python3 main.py \
111
- directory=/app/aiostreams \
112
- environment=PORT="3000",HOST="0.0.0.0" \
113
- autostart=true \
114
- autorestart=true \
115
- \
116
- [program:prowlarr] \
117
- command=/app/Prowlarr/Prowlarr -nobrowser -data=/data/prowlarr \
118
- directory=/app/Prowlarr \
119
- environment=PROWLARR__GENERAL__URLBASE="/prowlarr" \
120
- autostart=true \
121
- autorestart=true \
122
- """; \
123
- with open("/etc/supervisor/conf.d/supervisord.conf", "w") as f: f.write(super_conf)'
124
-
125
- # 8. Fix Permissions
 
126
  RUN chown -R 1000:1000 /app /data /var/log/supervisor /var/lib/nginx /var/log/nginx /etc/nginx /run /etc/supervisor
127
 
128
  # 9. Launch
 
1
  # ---------------------------------------------------------------------------
2
+ # "THE GOD MONOLITH" - V6 (Here-Doc Edition & Dependency Fix)
3
  # ---------------------------------------------------------------------------
4
  FROM python:3.11-bookworm
5
 
6
+ # 1. Unlock Pip & Non-Interactive Mode
7
  ENV PIP_BREAK_SYSTEM_PACKAGES=1
8
+ ENV DEBIAN_FRONTEND=noninteractive
9
 
10
+ # 2. Install System Dependencies (Added libffi-dev for AIOStreams)
11
  USER root
12
  RUN apt-get update && apt-get install -y \
13
  nginx-full \
 
22
  libicu-dev \
23
  libssl-dev \
24
  libsqlite3-0 \
25
+ libffi-dev \
26
  socat \
27
  xvfb \
28
  && rm -rf /var/lib/apt/lists/*
 
53
  && rm Prowlarr.tar.gz
54
 
55
  # 5. Create Directories
56
+ 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
57
+
58
+ # 6. GENERATE NGINX CONFIG (Here-Doc Method - SAFE)
59
+ # 'EOF' in quotes prevents shell from messing with $host variables
60
+ RUN cat <<'EOF' > /etc/nginx/nginx.conf
61
+ worker_processes 1;
62
+ daemon off;
63
+ pid /run/nginx.pid;
64
+ events { worker_connections 1024; }
65
+ http {
66
+ include mime.types;
67
+ default_type application/octet-stream;
68
+ sendfile on;
69
+ keepalive_timeout 65;
70
+ access_log /var/log/nginx/access.log;
71
+ error_log /var/log/nginx/error.log;
72
+ server {
73
+ listen 7860;
74
+ server_name localhost;
75
+ location / {
76
+ proxy_pass http://127.0.0.1:3000;
77
+ proxy_set_header Host $host;
78
+ proxy_set_header X-Real-IP $remote_addr;
79
+ }
80
+ location /prowlarr {
81
+ proxy_pass http://127.0.0.1:9696;
82
+ proxy_set_header Host $host;
83
+ proxy_set_header X-Real-IP $remote_addr;
84
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
85
+ proxy_set_header X-Forwarded-Proto $scheme;
86
+ proxy_http_version 1.1;
87
+ proxy_set_header Upgrade $http_upgrade;
88
+ proxy_set_header Connection "Upgrade";
89
+ }
90
+ }
91
+ }
92
+ EOF
93
+
94
+ # 7. GENERATE SUPERVISOR CONFIG (Here-Doc Method - SAFE)
95
+ RUN cat <<'EOF' > /etc/supervisor/conf.d/supervisord.conf
96
+ [supervisord]
97
+ nodaemon=true
98
+ logfile=/var/log/supervisor/supervisord.log
99
+ pidfile=/run/supervisord.pid
100
+
101
+ [program:nginx]
102
+ command=/usr/sbin/nginx
103
+ autostart=true
104
+ autorestart=true
105
+
106
+ [program:flaresolverr]
107
+ command=python3 /app/flaresolverr/src/flaresolverr.py
108
+ directory=/app/flaresolverr
109
+ environment=LOG_LEVEL="info",LOG_HTML="false",PORT="8191",HOST="0.0.0.0"
110
+ autostart=true
111
+ autorestart=true
112
+
113
+ [program:aiostreams]
114
+ command=python3 main.py
115
+ directory=/app/aiostreams
116
+ environment=PORT="3000",HOST="0.0.0.0"
117
+ autostart=true
118
+ autorestart=true
119
+
120
+ [program:prowlarr]
121
+ command=/app/Prowlarr/Prowlarr -nobrowser -data=/data/prowlarr
122
+ directory=/app/Prowlarr
123
+ environment=PROWLARR__GENERAL__URLBASE="/prowlarr"
124
+ autostart=true
125
+ autorestart=true
126
+ EOF
127
+
128
+ # 8. Fix Permissions (Give user 1000 control over everything)
129
  RUN chown -R 1000:1000 /app /data /var/log/supervisor /var/lib/nginx /var/log/nginx /etc/nginx /run /etc/supervisor
130
 
131
  # 9. Launch