This commit is contained in:
2025-05-06 11:36:10 +08:00
parent 3a624ba8d1
commit 102c108074
14 changed files with 1571 additions and 73 deletions

1
docker/keydb/dockerfile Normal file
View File

@@ -0,0 +1 @@
FROM eqalpha/keydb:latest AS iptv-keydb

1
docker/nginx/dockerfile Normal file
View File

@@ -0,0 +1 @@
FROM nginx:latest AS iptv-nginx

View File

@@ -20,7 +20,7 @@ server {
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php:9000;
fastcgi_pass php-main:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

View File

@@ -0,0 +1,17 @@
#!/bin/bash
echo "Current pwd: $(pwd)"
for file in "/etc/cron.d/iptv_jobs" "/var/www/iptv-cli"; do
if [ ! -f "$file" ]; then echo "Not found: $file" && exit 1; fi
done;
echo "Importing crontab /etc/cron.d/iptv_jobs:"
echo "======================="
cat /etc/cron.d/iptv_jobs
echo "======================="
crontab -n /etc/cron.d/iptv_jobs || exit 2
echo "Running cron with /etc/cron.d/iptv_jobs"
crontab /etc/cron.d/iptv_jobs
touch /var/log/cron.log
cron -L 15 && tail -fn 1 /var/log/cron.log

5
docker/php/dev/cron_jobs Normal file
View File

@@ -0,0 +1,5 @@
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PHP_IDE_CONFIG=serverName=iptv.local
* * * * * /var/www/iptv-cli check:ini --count 5 --order random

View File

@@ -1,21 +0,0 @@
FROM php:8.3-fpm
RUN apt update && \
apt upgrade -y && \
apt install -y git unzip 7zip
# https://pecl.php.net/package/xdebug
# https://pecl.php.net/package/redis
RUN pecl channel-update pecl.php.net && \
pecl install xdebug-3.4.1 redis && \
docker-php-ext-enable redis && \
mkdir -p /var/run/php && \
mkdir -p /var/log/php && \
chmod -R 777 /var/log/php
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
EXPOSE 9000
WORKDIR /var/www
CMD composer install
ENTRYPOINT php-fpm

View File

@@ -0,0 +1,44 @@
FROM php:8.4-fpm AS iptv-img-base
RUN apt update && \
apt upgrade -y && \
apt install -y \
git \
unzip \
7zip \
cron \
zlib1g-dev \
imagemagick \
libpng-dev \
libjpeg-dev
# https://pecl.php.net/package/xdebug
# https://pecl.php.net/package/redis
RUN pecl channel-update pecl.php.net && \
pecl install \
xdebug-3.4.1 \
redis-6.1.0
RUN docker-php-ext-enable redis && \
docker-php-ext-configure gd --with-jpeg && \
docker-php-ext-install gd && \
docker-php-ext-configure pcntl --enable-pcntl && \
docker-php-ext-install pcntl
RUN mkdir -p /var/run/php && \
mkdir -p /var/log/php && \
chmod -R 777 /var/log/php
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
RUN git config --global --add safe.directory /var/www
EXPOSE 9000
WORKDIR /var/www
CMD ["composer", "install"]
################################################################
FROM iptv-img-base AS iptv-img-cron
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,44 @@
FROM php:8.4-fpm AS iptv-img-base
RUN apt update && \
apt upgrade -y && \
apt install -y \
git \
unzip \
7zip \
cron \
zlib1g-dev \
imagemagick \
libpng-dev \
libjpeg-dev
# https://pecl.php.net/package/xdebug
# https://pecl.php.net/package/redis
RUN pecl channel-update pecl.php.net && \
pecl install \
xdebug-3.4.1 \
redis-6.1.0
RUN docker-php-ext-enable xdebug redis && \
docker-php-ext-configure gd --with-jpeg && \
docker-php-ext-install gd && \
docker-php-ext-configure pcntl --enable-pcntl && \
docker-php-ext-install pcntl
RUN mkdir -p /var/run/php && \
mkdir -p /var/log/php && \
chmod -R 777 /var/log/php
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
RUN git config --global --add safe.directory /var/www
EXPOSE 9000
WORKDIR /var/www
CMD ["composer", "install"]
################################################################
FROM iptv-img-base AS iptv-img-main
ENTRYPOINT ["php-fpm", "--nodaemonize"]

View File

@@ -1,5 +1,5 @@
[PHP]
error_reporting = E_ALL
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
expose_php = Off
file_uploads = Off
max_execution_time=-1

View File

@@ -11,11 +11,12 @@ pm.max_requests = 50
pm.status_path = /status
ping.path = /ping
ping.response = pong
access.log = /var/log/php/$pool.access.log
access.log = /var/www/$pool.access.log
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
; chroot = /var/www
; chdir = /var/www
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php/$pool.error.log
php_admin_value[error_log] = /var/www/$pool.error.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 512M
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_DEPRECATED