From 7727a0b4efe5c7f756d2200a0b69be1e18f11f9b Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 15 Jul 2024 11:24:09 +0100 Subject: [PATCH] add php8.2 --- .gitea/workflows/build.yaml | 10 ++++++---- {php-cli => php-8-1-cli}/Dockerfile | 4 ++-- {php-cli => php-8-1-cli}/crontab | 0 {php-cli => php-8-1-cli}/petroq.service | 0 php-8-2-cli/Dockerfile | 20 ++++++++++++++++++++ php-8-2-cli/crontab | 6 ++++++ php-8-2-cli/petroq.service | 20 ++++++++++++++++++++ 7 files changed, 54 insertions(+), 6 deletions(-) rename {php-cli => php-8-1-cli}/Dockerfile (87%) rename {php-cli => php-8-1-cli}/crontab (100%) rename {php-cli => php-8-1-cli}/petroq.service (100%) create mode 100644 php-8-2-cli/Dockerfile create mode 100644 php-8-2-cli/crontab create mode 100644 php-8-2-cli/petroq.service diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c183fd7..ef78cf7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,10 +18,12 @@ jobs: run: docker buildx create --name buildx --driver=docker-container - name: Build nginx-web run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./nginx-web -t git.tgj.services/thatguyjack/nginx-web:latest --push - - name: Build php-CLI - run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-cli/ -t git.tgj.services/thatguyjack/php-cli:latest --push - - name: Build motioneye - run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./motioneye -t git.tgj.services/thatguyjack/motioneye:latest --push + - name: Build php-8.1-CLI + run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-8-1-cli/ -t git.tgj.services/thatguyjack/php-cli:8.1 --push + - name: Build php-8.1-CLI + run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-8-1-cli/ -t git.tgj.services/thatguyjack/php-cli:latest --push + - name: Build php-8.2-CLI + run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-8-2-cli/ -t git.tgj.services/thatguyjack/php-cli:8.2 --push - name: Build php-FPM run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-fpm/ -t git.tgj.services/thatguyjack/php-fpm:latest --push # - name: Push diff --git a/php-cli/Dockerfile b/php-8-1-cli/Dockerfile similarity index 87% rename from php-cli/Dockerfile rename to php-8-1-cli/Dockerfile index 2c14654..7bbf29c 100644 --- a/php-cli/Dockerfile +++ b/php-8-1-cli/Dockerfile @@ -9,8 +9,8 @@ RUN docker-php-ext-install pdo_mysql opcache gd zip ldap COPY ./crontab /etc/cron.d/crontab -COPY ./petroq.service /etc/systemd/system -RUN systemctl enable --now pteroq.service +#COPY ./petroq.service /etc/systemd/system +#RUN systemctl enable --now pteroq.service RUN chmod 0644 /etc/cron.d/crontab RUN /usr/bin/crontab /etc/cron.d/crontab diff --git a/php-cli/crontab b/php-8-1-cli/crontab similarity index 100% rename from php-cli/crontab rename to php-8-1-cli/crontab diff --git a/php-cli/petroq.service b/php-8-1-cli/petroq.service similarity index 100% rename from php-cli/petroq.service rename to php-8-1-cli/petroq.service diff --git a/php-8-2-cli/Dockerfile b/php-8-2-cli/Dockerfile new file mode 100644 index 0000000..5128700 --- /dev/null +++ b/php-8-2-cli/Dockerfile @@ -0,0 +1,20 @@ +FROM php:8.2-cli + +# installing cron package +RUN apt-get update && apt-get -y install cron libbz2-dev curl libcurl4-openssl-dev libxml2-dev libenchant-2-dev libssl-dev libpng-dev libgmp-dev libzip-dev sudo rsync zip unzip libldap2-dev + +RUN pecl install redis && docker-php-ext-enable redis + +RUN docker-php-ext-install pdo_mysql opcache gd zip ldap + +COPY ./crontab /etc/cron.d/crontab + +#COPY ./petroq.service /etc/systemd/system +#RUN systemctl enable --now pteroq.service +RUN chmod 0644 /etc/cron.d/crontab + +RUN /usr/bin/crontab /etc/cron.d/crontab + +RUN adduser -D -H -u 1000 -s /bin/bash www-data -G www-data +RUN usermod -u 1000 www-data +RUN groupmod -g 1000 www-data diff --git a/php-8-2-cli/crontab b/php-8-2-cli/crontab new file mode 100644 index 0000000..f8d40e6 --- /dev/null +++ b/php-8-2-cli/crontab @@ -0,0 +1,6 @@ +*/5 * * * * sudo -u www-data php -d memory_limit=512M -f /var/www/nextcloud/cron.php + +* * * * * sudo -u www-data php -d memory_limit=512M /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1 +* * * * * cd /var/www/invoice-ninja && sudo -u www-data php -d memory_limit=512M artisan schedule:run >> /dev/null 2>&1 + +18 11 * * * /var/www/email.tgj.services/site/bin/cleandb.sh diff --git a/php-8-2-cli/petroq.service b/php-8-2-cli/petroq.service new file mode 100644 index 0000000..6663bb9 --- /dev/null +++ b/php-8-2-cli/petroq.service @@ -0,0 +1,20 @@ +# Pterodactyl Queue Worker File +# ---------------------------------- + +[Unit] +Description=Pterodactyl Queue Worker +After=redis-server.service + +[Service] +# On some systems the user and group might be different. +# Some systems use `apache` or `nginx` as the user and group. +User=www-data +Group=www-data +Restart=always +ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 +StartLimitInterval=180 +StartLimitBurst=30 +RestartSec=5s + +[Install] +WantedBy=multi-user.target \ No newline at end of file