Update Dockerfile
Browse files- Dockerfile +78 -75
Dockerfile
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
# ---------------------------------------------------------------------------
|
| 2 |
-
# "THE GOD MONOLITH" -
|
| 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 (
|
| 57 |
-
#
|
| 58 |
-
RUN
|
| 59 |
-
|
| 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 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
proxy_set_header
|
| 81 |
-
proxy_set_header X-
|
| 82 |
-
|
| 83 |
-
proxy_set_header
|
| 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 |
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
|