From f2a8fce93f68e66fe510fde54815d0d927757950 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Tue, 10 Dec 2024 23:01:59 +0800 Subject: [PATCH 1/7] ci: :construction_worker: changed to building imagick from source --- .kube/app/Dockerfile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index cbf898951..866a4571c 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -1,6 +1,7 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 +ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version and ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 ENV NVM_DIR /var/www/.nvm @@ -36,9 +37,29 @@ RUN apt-get install -y \ RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) gd pdo_mysql mbstring exif pcntl bcmath bz2 zip soap intl opcache -RUN apt-get install -y libmagickwand-dev --no-install-recommends +RUN apt-get install -y \ + libmagickwand-dev \ + libmagickcore-dev \ + --no-install-recommends -RUN pecl install imagick +# START BUILDING IMAGICK FROM SOURCE - this can be removed once pecl fixes issues installing with php8.4 +RUN apt-get install -y \ + $PHPIZE_DEPS \ + libtool + +RUN mkdir -p /tmp/imagick +WORKDIR /tmp/imagick +RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/tags/${IMAGICK_VERSION}.tar.gz +RUN tar --strip-components=1 -xf /tmp/imagick.tar.gz +RUN phpize +RUN ./configure +RUN make +RUN make install +WORKDIR / +RUN rm -rf /tmp/imagick +# END BUILDING IMAGICK FROM SOURCE + +# RUN pecl install imagick RUN docker-php-ext-enable imagick RUN printf "\n" | pecl install apcu @@ -48,6 +69,11 @@ RUN pecl install -o -f redis && \ rm -rf /tmp/pear && \ docker-php-ext-enable redis +# - this can be removed once pecl fixes issues installing with php8.4 +RUN apt-get remove -y \ + $PHPIZE_DEPS \ + libtool + COPY --from=composer:latest /usr/bin/composer /usr/bin/composer RUN mkdir -p $NVM_DIR From 2383d1d6f62c23f6a6f9edc83912cb438013abc2 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Wed, 11 Dec 2024 23:29:03 +0800 Subject: [PATCH 2/7] docs: :memo: updated docker comments --- .kube/app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index 866a4571c..01d2fac04 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -1,7 +1,7 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 -ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version and +ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 ENV NVM_DIR /var/www/.nvm From c112d1d3abdf67c834444c7b486460deb433cb53 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Wed, 11 Dec 2024 23:35:46 +0800 Subject: [PATCH 3/7] docs: :memo: added reference to issue in comments --- .kube/app/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index 01d2fac04..4686acae3 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -1,7 +1,7 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 -ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped +ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped and can be removed when https://github.com/accessibility-exchange/platform/issues/2425 is resolved ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 ENV NVM_DIR /var/www/.nvm @@ -43,6 +43,7 @@ RUN apt-get install -y \ --no-install-recommends # START BUILDING IMAGICK FROM SOURCE - this can be removed once pecl fixes issues installing with php8.4 +# see issue https://github.com/accessibility-exchange/platform/issues/2425 RUN apt-get install -y \ $PHPIZE_DEPS \ libtool From e5adff573381e72de5e90d8406914c71065cbfc4 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Wed, 11 Dec 2024 23:38:50 +0800 Subject: [PATCH 4/7] docs: added TODOs for the removal of items --- .kube/app/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index 4686acae3..211a85eae 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -1,6 +1,7 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 +# TODO - IMAGICK_VERSION can be removed once pecl fixes issues installing with php8.4 ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped and can be removed when https://github.com/accessibility-exchange/platform/issues/2425 is resolved ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 @@ -44,6 +45,7 @@ RUN apt-get install -y \ # START BUILDING IMAGICK FROM SOURCE - this can be removed once pecl fixes issues installing with php8.4 # see issue https://github.com/accessibility-exchange/platform/issues/2425 +# TODO - this can be removed once pecl fixes issues installing with php8.4 RUN apt-get install -y \ $PHPIZE_DEPS \ libtool @@ -70,7 +72,7 @@ RUN pecl install -o -f redis && \ rm -rf /tmp/pear && \ docker-php-ext-enable redis -# - this can be removed once pecl fixes issues installing with php8.4 +# TODO - this can be removed once pecl fixes issues installing with php8.4 RUN apt-get remove -y \ $PHPIZE_DEPS \ libtool From 76088ffb424fd2d47a6ea0a95fcd8572f34b697f Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Mon, 16 Dec 2024 17:03:18 +0800 Subject: [PATCH 5/7] docs: :memo: updated issue referenced in todo comments --- .kube/app/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index 211a85eae..4f603213e 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -2,7 +2,7 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 # TODO - IMAGICK_VERSION can be removed once pecl fixes issues installing with php8.4 -ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped and can be removed when https://github.com/accessibility-exchange/platform/issues/2425 is resolved +ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped and can be removed when https://github.com/Imagick/imagick/issues/698 is resolved ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 ENV NVM_DIR /var/www/.nvm @@ -44,8 +44,7 @@ RUN apt-get install -y \ --no-install-recommends # START BUILDING IMAGICK FROM SOURCE - this can be removed once pecl fixes issues installing with php8.4 -# see issue https://github.com/accessibility-exchange/platform/issues/2425 -# TODO - this can be removed once pecl fixes issues installing with php8.4 +# TODO - this can be removed when https://github.com/Imagick/imagick/issues/698 is resolved RUN apt-get install -y \ $PHPIZE_DEPS \ libtool @@ -72,7 +71,7 @@ RUN pecl install -o -f redis && \ rm -rf /tmp/pear && \ docker-php-ext-enable redis -# TODO - this can be removed once pecl fixes issues installing with php8.4 +# TODO - this can be removed when https://github.com/Imagick/imagick/issues/698 is resolved RUN apt-get remove -y \ $PHPIZE_DEPS \ libtool From a66c90638ecf9ff3d6bfb3443844d6f93ad1a7f6 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Wed, 8 Jan 2025 01:11:41 +0800 Subject: [PATCH 6/7] fix: imagick version as variable not working in curl command --- .kube/app/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.kube/app/Dockerfile b/.kube/app/Dockerfile index 4f603213e..27f7c316f 100644 --- a/.kube/app/Dockerfile +++ b/.kube/app/Dockerfile @@ -1,8 +1,6 @@ FROM php:8.4-fpm ENV PHP_VERSION 8.4 -# TODO - IMAGICK_VERSION can be removed once pecl fixes issues installing with php8.4 -ENV IMAGICK_VERSION 3.7.0 # This should be bumped to the latest version, especially when PHP version is bumped and can be removed when https://github.com/Imagick/imagick/issues/698 is resolved ENV NODE_VERSION 22.11.0 ENV NVM_VERSION 0.40.1 ENV NVM_DIR /var/www/.nvm @@ -51,7 +49,7 @@ RUN apt-get install -y \ RUN mkdir -p /tmp/imagick WORKDIR /tmp/imagick -RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/tags/${IMAGICK_VERSION}.tar.gz +RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz # upgrade version when bumping PHP version RUN tar --strip-components=1 -xf /tmp/imagick.tar.gz RUN phpize RUN ./configure From 224b7b1265e4629c70708629c5673d8cdce29b17 Mon Sep 17 00:00:00 2001 From: Marvin Roman Date: Wed, 29 Jan 2025 00:22:33 +0800 Subject: [PATCH 7/7] docs: :memo: removed instructions for straight docker compose --- README.md | 132 ------------------------------------------------------ 1 file changed, 132 deletions(-) diff --git a/README.md b/README.md index 781eebb31..52a566cfb 100644 --- a/README.md +++ b/README.md @@ -179,138 +179,6 @@ of how some key tasks can be carried out using Herd: Herd supports debuging via XDebug. The article "[Activating XDebug on Visual Studio Code & Laravel Herd](https://thomashysselinckx.medium.com/activating-xdebug-on-visual-studio-code-laravel-herd-cfd0553d26e0)" can help if you are having trouble getting it setup with VS Code. -### Local development setup using docker compose: -1. Install docker according to your platform instructions found [here](https://docs.docker.com/get-docker/). -2. Clone the repository: - - ```bash - git clone https://github.com/accessibility-exchange/platform.git && cd platform - ``` - -3. Create a `.env` file from the included example file: - - ```bash - cp .env.local.example .env - ``` - - Then, change the `APP_ENV` value to `local`: - - ```dotenv - APP_ENV=local - ``` - -4. Generate an encryption key for [CipherSweet](https://github.com/spatie/laravel-ciphersweet): - - ```bash - docker run --rm -it alpine apk add openssl && openssl rand -hex 32 - ``` - - Add it to your `.env` file: - - ```dotenv - CIPHERSWEET_KEY="" - ``` - -5. Generate your database password: - - ```bash - docker run --rm -it alpine apk add openssl && openssl rand -hex 32 - ``` - - Add it to your `.env` file: - - ```dotenv - DB_PASSWORD="" - ``` - -6. Generate your redis password: - - ```bash - docker run --rm -it alpine apk add openssl && openssl rand -hex 20 - ``` - - Add it to your `.env` file: - - ```dotenv - REDIS_PASSWORD="" - ``` - -7. Generate an application key: - - ```bash - docker compose -f docker-compose.local.yml run --rm --entrypoint '' platform.test php artisan key:generate --show - ``` - - Add it to your `.env` file: - - ```dotenv - APP_KEY="" - ``` - -8. Alter the numerical IDs that PHP will run as in the application container: - Reason: your local directories will be mapped into the application container to allow your changes to be viewed in real time. - - Find your local user ID & GROUP (Linux & MacOS): - - ```bash - ls -ln - ``` - - You will see output like below. In the below case user is `1000` and group id is `1001`. - - ```bash - total 1124 - drwxr-xr-x 18 1000 1001 4096 Mar 20 12:56 app - -rwxr-xr-x 1 1000 1001 1686 Nov 2 12:10 artisan - ``` - - Add them to your `.env` file: - - ```dotenv - WWWUSER= - WWWGROUP= - ``` - -9. Re-build you application container after the `.env` file updates: - - ```bash - docker compose -f docker-compose.local.yml build platform.test - ``` - -10. Start up the entire stack: - - ```bash - docker compose -f docker-compose.local.yml up -d - ``` - -11. If you are going to be committing code changes you will want to copy the php packages from the container and install node packages. - - ```bash - docker cp platform.test:/app/vendor ./vendor - nvm use - npm ci - ``` - -For comprehensive instructions, consult the [Laravel documentation](https://laravel.com/docs/10.x). Here's an overview of how some key tasks can be carried out using your containers: - -- Visit the site using the SSL proxy to make sure assets load [https://localhost](https://localhost). -- [Artisan](https://laravel.com/docs/10.x/artisan) commands may be executed by using `docker exec --user www-data platform.test php artisan `. -- [NPM](https://docs.npmjs.com/cli/v7) commands may be executed by using `docker exec --user www-data platform.test npm `. -- [Composer](https://getcomposer.org) commands may be executed by using `docker exec --user www-data platform.test composer `. -- !(preferred way) If you want to enter the container to run commands as **www-data** user (which is best when the command will create files) then use `docker exec --user www-data -it platform.test bash`. -- If you want to enter the container to run commands as **root** user then use `docker exec -it platform.test bash`. - -#### Troubleshooting - -**Changes are missing in the container** - -- Rebuild the container and relaunch with the following command `docker compose -f docker-compose.local.yml build platform.test && docker compose -f docker-compose.local.yml up -d`. - -**Cannot reach site using browser** - -- Check that all containers are up and running using the following command `docker ps -a` and check for container with the name `platform.test` and check the status column to see if it says **Up**. -- If it's not up then try to check logs to see if there is an error with the command `docker compose -f docker-compose.local.yml logs -f platform.test`. This should help you resolve what might be missing. - ### Running tests The project uses [Pest](http://pestphp.com) for testing. For more information about testing Laravel, [read the documentation](https://laravel.com/docs/10.x/testing).