From 1124d760455c69b9fc2b03a99068d386f45c1858 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 12 Nov 2024 14:08:09 +0000 Subject: [PATCH] removed ARM images (unused), Migrated php-2.2 CLI crons to the FPM image --- .gitea/workflows/build.yaml | 10 +++--- .../php-8-2-cli}/Dockerfile | 0 .../php-8-2-cli}/petroq.service | 0 nginx-web/configs/nginx.conf | 5 +-- php-8-2-fpm/Dockerfile | 33 +++++++++++-------- {php-8-2-cli => php-8-2-fpm}/crontab | 0 6 files changed, 27 insertions(+), 21 deletions(-) rename {php-8-2-cli => Archive/php-8-2-cli}/Dockerfile (100%) rename {php-8-2-cli => Archive/php-8-2-cli}/petroq.service (100%) rename {php-8-2-cli => php-8-2-fpm}/crontab (100%) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 9994c2f..6463c0d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -17,15 +17,13 @@ jobs: - name: Buildx Container 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 + run: docker buildx build --builder=buildx --platform=linux/amd64 ./nginx-web -t git.tgj.services/thatguyjack/nginx-web: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.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 + run: docker buildx build --builder=buildx --platform=linux/amd64 ./php-8-1-cli/ -t git.tgj.services/thatguyjack/php-cli:8.1 --push - name: Build php8-1-FPM - run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-8-1-fpm/ -t git.tgj.services/thatguyjack/php-fpm:8.1 --push + run: docker buildx build --builder=buildx --platform=linux/amd64 ./php-8-1-fpm/ -t git.tgj.services/thatguyjack/php-fpm:8.1 --push - name: Build php-8-2-FPM - run: docker buildx build --builder=buildx --platform=linux/amd64,linux/arm64 ./php-8-2-fpm/ -t git.tgj.services/thatguyjack/php-fpm:8.2 --push + run: docker buildx build --builder=buildx --platform=linux/amd64 ./php-8-2-fpm/ -t git.tgj.services/thatguyjack/php-fpm:8.2 --push # - name: Push # run: | # docker push git.tgj.services/thatguyjack/php-fpm:latest diff --git a/php-8-2-cli/Dockerfile b/Archive/php-8-2-cli/Dockerfile similarity index 100% rename from php-8-2-cli/Dockerfile rename to Archive/php-8-2-cli/Dockerfile diff --git a/php-8-2-cli/petroq.service b/Archive/php-8-2-cli/petroq.service similarity index 100% rename from php-8-2-cli/petroq.service rename to Archive/php-8-2-cli/petroq.service diff --git a/nginx-web/configs/nginx.conf b/nginx-web/configs/nginx.conf index f951f49..0b39883 100644 --- a/nginx-web/configs/nginx.conf +++ b/nginx-web/configs/nginx.conf @@ -12,13 +12,14 @@ http { server_names_hash_bucket_size 128; # set_real_ip_from 172.18.0.0/16; # set_real_ip_from fd00:0:0:0:2::/64; + real_ip_recursive on; real_ip_header X-Forwarded-For; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - sub_filter '' ' '; - sub_filter_once on; +# sub_filter '' ' '; +# sub_filter_once on; ## # Basic Settings diff --git a/php-8-2-fpm/Dockerfile b/php-8-2-fpm/Dockerfile index 300d80d..0de475d 100644 --- a/php-8-2-fpm/Dockerfile +++ b/php-8-2-fpm/Dockerfile @@ -13,6 +13,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && chmod uga+x /usr/local/bin/install-php-extensions && sync RUN install-php-extensions bcmath \ + gmp \ bz2 \ smbclient \ calendar \ @@ -43,29 +44,26 @@ RUN install-php-extensions bcmath \ xmlrpc \ xsl \ zip \ - gmp + bcmath -#RUN apk add --no-cache ssmbclient - -RUN echo -e "\n opcache.enable=1 \n opcache.enable_cli=1 \n opcache.memory_consumption=2048 \n opcache.interned_strings_buffer=1024 \n opcache.max_accelerated_files=8000 \n opcache.revalidate_freq=60 \n opcache.fast_shutdown=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \ +#RUN apk add --no-cache libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libpangocairo-1.0-0 libgtk-3-0 +RUN apk add chromium +RUN echo -e "\n opcache.enable=1 \n opcache.enable_cli=1 \n opcache.memory_consumption=2048 \n opcache.interned_strings_buffer=1024 \n opcache.max_accelerated_files=8000 \n opcache.revalidate_freq=60 \n opcache.fast_shutdown=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \ && echo -e "\n xdebug.remote_enable=1 \n xdebug.remote_host=localhost \n xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ && echo -e "\n xhprof.output_dir='/var/tmp/xhprof'" >> /usr/local/etc/php/conf.d/docker-php-ext-xhprof.ini \ - && cd ~ - + && cd ~ \ # Install composer -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ + && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ && php -r "copy('https://composer.github.io/installer.sig', 'signature');" \ && php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('signature'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ - && php -r "unlink('composer-setup.php');" - + && php -r "unlink('composer-setup.php');" \ # Install WP-CLI -RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ + && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ && chmod +x wp-cli.phar \ - && mv wp-cli.phar /usr/local/bin/wp - + && mv wp-cli.phar /usr/local/bin/wp \ # Install msmtp - To Send Mails on Production & Development -RUN apk add msmtp + && apk add msmtp RUN apk add --no-cache gnupg @@ -78,3 +76,12 @@ RUN apk add \ && usermod -u 1000 www-data \ && groupmod -g 1000 www-data \ && apk del .shadow-deps + +RUN apk add sudo bash + + +COPY ./crontab /etc/cron.d/crontab + +RUN chmod 0644 /etc/cron.d/crontab + +RUN /usr/bin/crontab /etc/cron.d/crontab \ No newline at end of file diff --git a/php-8-2-cli/crontab b/php-8-2-fpm/crontab similarity index 100% rename from php-8-2-cli/crontab rename to php-8-2-fpm/crontab