mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Update for php8.5
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
LABEL maintainer="Fossil01"
|
||||
|
||||
ARG WWWGROUP
|
||||
ARG NODE_VERSION=22
|
||||
ARG POSTGRES_VERSION=17
|
||||
ARG SEVENZIP_VERSION=2409
|
||||
ARG MYSQL_CLIENT="mariadb-client"
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install base packages and add repositories
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip unrar 7zip lame git supervisor sqlite3 libcap2-bin libpng-dev python3 dnsutils \
|
||||
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/nginx/ubuntu noble main" > /etc/apt/sources.list.d/ppa_ondrej_nginx.list \
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update
|
||||
|
||||
# Install core PHP packages
|
||||
RUN apt-get install -y php8.5 php8.5-cli php8.5-common php8.5-dev php8.5-fpm \
|
||||
php8.5-bcmath php8.5-bz2 php8.5-curl php8.5-gd php8.5-gmp \
|
||||
php8.5-intl php8.5-mbstring php8.5-mysql \
|
||||
php8.5-readline php8.5-soap php8.5-sqlite3 php8.5-xml php8.5-xsl \
|
||||
php8.5-zip php8.5-pgsql
|
||||
|
||||
# Install optional PHP extensions (skip if not available)
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
php8.5-sockets php8.5-imap php8.5-ldap \
|
||||
php8.5-amqp php8.5-gnupg php8.5-http php8.5-igbinary php8.5-imagick \
|
||||
php8.5-msgpack php8.5-oauth php8.5-raphf php8.5-redis php8.5-swoole \
|
||||
php8.5-tidy php8.5-uploadprogress php8.5-uuid php8.5-xmlrpc \
|
||||
php8.5-yaml php8.5-zstd php8.5-memcached php8.5-pcov php8.5-xdebug \
|
||||
|| true
|
||||
|
||||
# Install other packages
|
||||
RUN apt-get install -y \
|
||||
tmux iputils-ping net-tools ffmpeg \
|
||||
sudo jq htop fonts-powerline nano bash-completion time wget cron \
|
||||
nginx jpegoptim webp optipng pngquant libavif-bin
|
||||
|
||||
# Install mediainfo
|
||||
RUN wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-25_all.deb \
|
||||
&& dpkg -i repo-mediaarea_1.0-25_all.deb \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y libmediainfo0v5 mediainfo libzen0v5 \
|
||||
&& rm -f repo-mediaarea_1.0-25_all.deb
|
||||
|
||||
# Install Composer
|
||||
RUN curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
|
||||
|
||||
# Install Node.js
|
||||
RUN curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm bun pnpm
|
||||
|
||||
# Install remaining packages and cleanup
|
||||
RUN apt-get install -y yarn $MYSQL_CLIENT postgresql-client-$POSTGRES_VERSION \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Determine ARCH and download and extract the appropriate version of 7-Zip
|
||||
RUN ARCH="$(dpkg --print-architecture)" && \
|
||||
if [ "$ARCH" = "amd64" ]; then \
|
||||
SZIP_URL="https://www.7-zip.org/a/7z$SEVENZIP_VERSION-linux-x64.tar.xz"; \
|
||||
fi && \
|
||||
if [ "$ARCH" = "arm64" ]; then \
|
||||
SZIP_URL="https://www.7-zip.org/a/7z$SEVENZIP_VERSION-linux-arm64.tar.xz"; \
|
||||
fi && \
|
||||
wget "$SZIP_URL" -O /tmp/7z.tar.xz && \
|
||||
tar -xf /tmp/7z.tar.xz -C /tmp/ && \
|
||||
mv /tmp/7zz /usr/bin/7zz && \
|
||||
rm -f /tmp/7z.tar.xz && rm -f /tmp/7zzs
|
||||
|
||||
RUN groupadd --force -g $WWWGROUP sail
|
||||
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
|
||||
RUN echo "alias artisan=\"php artisan\"" >> /home/sail/.bashrc
|
||||
|
||||
COPY scheduler /etc/cron.d/scheduler
|
||||
RUN chmod 0644 /etc/cron.d/scheduler \
|
||||
&& crontab /etc/cron.d/scheduler
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY nginx.conf /etc/nginx/sites-available/default
|
||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||
COPY php.ini /etc/php/8.5/cli/conf.d/99-sail.ini
|
||||
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
#ENTRYPOINT ["tail", "-f", "/dev/null"] # Use only for debugging
|
||||
ENTRYPOINT ["start-container"]
|
||||
@@ -0,0 +1,50 @@
|
||||
server {
|
||||
listen 80;
|
||||
root "/var/www/html/public";
|
||||
index index.html index.htm index.php;
|
||||
charset utf-8;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/xml application/xml+rss application/atom+xml image/x-icon font/opentype application/json;
|
||||
gzip_min_length 256;
|
||||
gzip_vary on;
|
||||
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
|
||||
# Brotli compression (requires libnginx-mod-http-brotli-filter and libnginx-mod-http-brotli-static)
|
||||
# Uncomment these lines after installing the brotli module
|
||||
#brotli on;
|
||||
#brotli_comp_level 6;
|
||||
#brotli_static on;
|
||||
#brotli_types application/atom+xml application/javascript application/json application/rss+xml
|
||||
#application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
|
||||
#application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
|
||||
#font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
|
||||
#image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml text/html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
location ^~ /covers/ {
|
||||
root /var/www/html/storage;
|
||||
}
|
||||
|
||||
access_log /dev/stdout;
|
||||
error_log stderr error;
|
||||
|
||||
sendfile off;
|
||||
|
||||
client_max_body_size 100m;
|
||||
|
||||
location ~ \.php$ {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass unix:/run/php/php8.5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[PHP]
|
||||
post_max_size = 100M
|
||||
upload_max_filesize = 100M
|
||||
variables_order = EGPCS
|
||||
max_execution_time = 300
|
||||
memory_limit = 2048M
|
||||
error_reporting = E_ALL
|
||||
log_errors = On
|
||||
error_log = php-errors.log
|
||||
|
||||
[Date]
|
||||
date.timezone = Europe/Amsterdam
|
||||
@@ -0,0 +1 @@
|
||||
* * * * * root cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z "$WWWUSER" ]; then
|
||||
usermod -u $WWWUSER sail
|
||||
fi
|
||||
|
||||
if [ ! -d /.composer ]; then
|
||||
mkdir /.composer
|
||||
fi
|
||||
|
||||
chmod -R ugo+rw /.composer
|
||||
addgroup supervisor > /dev/null 2>&1
|
||||
usermod -a -G supervisor sail > /dev/null 2>&1
|
||||
|
||||
# Set timezone
|
||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
exec gosu $WWWUSER "$@"
|
||||
else
|
||||
exec /usr/bin/supervisord --nodaemon -c /etc/supervisor/supervisord.conf
|
||||
fi
|
||||
@@ -0,0 +1,45 @@
|
||||
[unix_http_server]
|
||||
file=/opt/supervisor.sock ; the path to the socket file
|
||||
chmod=0700 ; socket file mode (default 0700)
|
||||
chown=root:supervisor ; socket file uid:gid owner
|
||||
|
||||
[supervisord]
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
||||
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
||||
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:////var/run/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[program:php-fpm]
|
||||
command=/usr/sbin/php-fpm8.5 --nodaemonize -c /etc/php/8.5/fpm/php-fpm.conf
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g "daemon off;"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startretries=5
|
||||
numprocs=1
|
||||
startsecs=0
|
||||
redirect_stderr=true
|
||||
|
||||
[program:horizon]
|
||||
process_name=%(program_name)s
|
||||
command=php /var/www/html/artisan horizon
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/www/html/storage/logs/horizon.log
|
||||
|
||||
[program:cron]
|
||||
command=/usr/sbin/cron -f -l 8
|
||||
autostart=true
|
||||
stdout_logfile=/var/log/cron.out.log
|
||||
redirect_stderr=true
|
||||
Reference in New Issue
Block a user