From 996d207797ae0e0d4b7645ec69ca4dd39715c204 Mon Sep 17 00:00:00 2001 From: Abderrahim Darghal Belkacemi Date: Thu, 20 Mar 2025 09:45:41 +0100 Subject: [PATCH 1/4] chore: update gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 898bb01..af2da23 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ /facturascripts/ /mysql/ .DS_Store -.vscode \ No newline at end of file +.vscode + +/test/*/facturascripts \ No newline at end of file From 2a67567e6565290737491ed05a0b2f1f935f482e Mon Sep 17 00:00:00 2001 From: Abderrahim Darghal Belkacemi Date: Thu, 20 Mar 2025 13:19:46 +0100 Subject: [PATCH 2/4] test: added other php containers for testing other versions --- docker-compose.yml | 29 ++++++++++++++++++++++++++++- test/php74/Dockerfile | 31 +++++++++++++++++++++++++++++++ test/php80/Dockerfile | 31 +++++++++++++++++++++++++++++++ test/php81/Dockerfile | 31 +++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 test/php74/Dockerfile create mode 100644 test/php80/Dockerfile create mode 100644 test/php81/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 6bccafa..57c8766 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ services: mysql: image: mysql:8.0 - command: --default-authentication-plugin=mysql_native_password + command: --authentication_policy=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: mypassword @@ -22,3 +22,30 @@ services: restart: always ports: - 8080:8080 + + # facturascripts74: + # build: + # context: ./test/php74 + # restart: always + # ports: + # - 8081:80 + # volumes: + # - ./test/php74/facturascripts:/var/www/html + + # facturascripts80: + # build: + # context: ./test/php80 + # restart: always + # ports: + # - 8082:80 + # volumes: + # - ./test/php80/facturascripts:/var/www/html + + # facturascripts81: + # build: + # context: ./test/php81 + # restart: always + # ports: + # - 8083:80 + # volumes: + # - ./test/php81/facturascripts:/var/www/html diff --git a/test/php74/Dockerfile b/test/php74/Dockerfile new file mode 100644 index 0000000..10459d6 --- /dev/null +++ b/test/php74/Dockerfile @@ -0,0 +1,31 @@ +FROM php:7.4-apache + +# Install dependencies +RUN apt-get update && \ + apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libpq-dev libzip-dev unzip libxml2-dev && \ + apt-get clean && \ + a2enmod rewrite + +# Install GD +RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-install gd + +# Install other extensions one by one +RUN docker-php-ext-install bcmath +RUN docker-php-ext-install mysqli pdo pdo_mysql pgsql zip +RUN docker-php-ext-install soap + +ENV FS_VERSION 2024.94 + +# Download FacturaScripts +ADD https://facturascripts.com/DownloadBuild/1/${FS_VERSION} /tmp/facturascripts.zip + +# Unzip +RUN unzip -q /tmp/facturascripts.zip -d /usr/src/; \ + rm -rf /tmp/facturascripts.zip + +VOLUME /var/www/html + +COPY facturascripts.sh /usr/local/bin/facturascripts +RUN chmod +x /usr/local/bin/facturascripts +CMD ["../../facturascripts"] diff --git a/test/php80/Dockerfile b/test/php80/Dockerfile new file mode 100644 index 0000000..eb17383 --- /dev/null +++ b/test/php80/Dockerfile @@ -0,0 +1,31 @@ +FROM php:8.0-apache + +# Install dependencies +RUN apt-get update && \ + apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libpq-dev libzip-dev unzip libxml2-dev && \ + apt-get clean && \ + a2enmod rewrite + +# Install GD +RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-install gd + +# Install other extensions one by one +RUN docker-php-ext-install bcmath +RUN docker-php-ext-install mysqli pdo pdo_mysql pgsql zip +RUN docker-php-ext-install soap + +ENV FS_VERSION 2024.94 + +# Download FacturaScripts +ADD https://facturascripts.com/DownloadBuild/1/${FS_VERSION} /tmp/facturascripts.zip + +# Unzip +RUN unzip -q /tmp/facturascripts.zip -d /usr/src/; \ + rm -rf /tmp/facturascripts.zip + +VOLUME /var/www/html + +COPY facturascripts.sh /usr/local/bin/facturascripts +RUN chmod +x /usr/local/bin/facturascripts +CMD ["../../facturascripts"] diff --git a/test/php81/Dockerfile b/test/php81/Dockerfile new file mode 100644 index 0000000..e179471 --- /dev/null +++ b/test/php81/Dockerfile @@ -0,0 +1,31 @@ +FROM php:8.1-apache + +# Install dependencies +RUN apt-get update && \ + apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libpq-dev libzip-dev unzip libxml2-dev && \ + apt-get clean && \ + a2enmod rewrite + +# Install GD +RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-install gd + +# Install other extensions one by one +RUN docker-php-ext-install bcmath +RUN docker-php-ext-install mysqli pdo pdo_mysql pgsql zip +RUN docker-php-ext-install soap + +ENV FS_VERSION 2024.94 + +# Download FacturaScripts +ADD https://facturascripts.com/DownloadBuild/1/${FS_VERSION} /tmp/facturascripts.zip + +# Unzip +RUN unzip -q /tmp/facturascripts.zip -d /usr/src/; \ + rm -rf /tmp/facturascripts.zip + +VOLUME /var/www/html + +COPY facturascripts.sh /usr/local/bin/facturascripts +RUN chmod +x /usr/local/bin/facturascripts +CMD ["../../facturascripts"] From 8bb759142434801bf8bf39d8c9edd5ac46bd18dc Mon Sep 17 00:00:00 2001 From: Abderrahim Darghal Belkacemi Date: Thu, 20 Mar 2025 14:00:40 +0100 Subject: [PATCH 3/4] fix: codigo innecesario eliminado --- docker-compose.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 57c8766..fd64a2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,30 +22,3 @@ services: restart: always ports: - 8080:8080 - - # facturascripts74: - # build: - # context: ./test/php74 - # restart: always - # ports: - # - 8081:80 - # volumes: - # - ./test/php74/facturascripts:/var/www/html - - # facturascripts80: - # build: - # context: ./test/php80 - # restart: always - # ports: - # - 8082:80 - # volumes: - # - ./test/php80/facturascripts:/var/www/html - - # facturascripts81: - # build: - # context: ./test/php81 - # restart: always - # ports: - # - 8083:80 - # volumes: - # - ./test/php81/facturascripts:/var/www/html From 6056b50ebe6b2ce755daab4b32ecfee1ea436d0b Mon Sep 17 00:00:00 2001 From: Abderrahim Darghal Belkacemi Date: Fri, 21 Mar 2025 12:23:12 +0100 Subject: [PATCH 4/4] refactor: cambios necesarios --- test/php74/Dockerfile | 2 +- test/php74/facturascripts.sh | 9 +++++++++ test/php80/Dockerfile | 2 +- test/php80/facturascripts.sh | 9 +++++++++ test/php81/Dockerfile | 2 +- test/php81/facturascripts.sh | 9 +++++++++ 6 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 test/php74/facturascripts.sh create mode 100644 test/php80/facturascripts.sh create mode 100644 test/php81/facturascripts.sh diff --git a/test/php74/Dockerfile b/test/php74/Dockerfile index 10459d6..682f7de 100644 --- a/test/php74/Dockerfile +++ b/test/php74/Dockerfile @@ -28,4 +28,4 @@ VOLUME /var/www/html COPY facturascripts.sh /usr/local/bin/facturascripts RUN chmod +x /usr/local/bin/facturascripts -CMD ["../../facturascripts"] +CMD ["facturascripts"] diff --git a/test/php74/facturascripts.sh b/test/php74/facturascripts.sh new file mode 100644 index 0000000..c77234f --- /dev/null +++ b/test/php74/facturascripts.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +FILE=/var/www/html/.htaccess +if [ ! -f "$FILE" ]; then + cp -r /usr/src/facturascripts/* /var/www/html/; \ + chmod -R o+w /var/www/html +fi + +apache2-foreground \ No newline at end of file diff --git a/test/php80/Dockerfile b/test/php80/Dockerfile index eb17383..8e0fba3 100644 --- a/test/php80/Dockerfile +++ b/test/php80/Dockerfile @@ -28,4 +28,4 @@ VOLUME /var/www/html COPY facturascripts.sh /usr/local/bin/facturascripts RUN chmod +x /usr/local/bin/facturascripts -CMD ["../../facturascripts"] +CMD ["facturascripts"] diff --git a/test/php80/facturascripts.sh b/test/php80/facturascripts.sh new file mode 100644 index 0000000..c77234f --- /dev/null +++ b/test/php80/facturascripts.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +FILE=/var/www/html/.htaccess +if [ ! -f "$FILE" ]; then + cp -r /usr/src/facturascripts/* /var/www/html/; \ + chmod -R o+w /var/www/html +fi + +apache2-foreground \ No newline at end of file diff --git a/test/php81/Dockerfile b/test/php81/Dockerfile index e179471..2683f69 100644 --- a/test/php81/Dockerfile +++ b/test/php81/Dockerfile @@ -28,4 +28,4 @@ VOLUME /var/www/html COPY facturascripts.sh /usr/local/bin/facturascripts RUN chmod +x /usr/local/bin/facturascripts -CMD ["../../facturascripts"] +CMD ["facturascripts"] diff --git a/test/php81/facturascripts.sh b/test/php81/facturascripts.sh new file mode 100644 index 0000000..c77234f --- /dev/null +++ b/test/php81/facturascripts.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +FILE=/var/www/html/.htaccess +if [ ! -f "$FILE" ]; then + cp -r /usr/src/facturascripts/* /var/www/html/; \ + chmod -R o+w /var/www/html +fi + +apache2-foreground \ No newline at end of file