diff --git a/.github/workflows/docker-build-develop.yml b/.github/workflows/docker-build-develop.yml index 552568aa..b29e3ed8 100644 --- a/.github/workflows/docker-build-develop.yml +++ b/.github/workflows/docker-build-develop.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - 'develop' + - "develop" jobs: build: runs-on: ubuntu-latest @@ -27,7 +27,7 @@ jobs: push: true tags: escolalms/api:${{github.ref_name}} platforms: linux/amd64 - + - name: Create the Mattermost Message run: | echo "{\"text\":\"There is a new [escolalms/api:develop](https://hub.docker.com/r/escolalms/api/tags?page=1&name=develop) image built. k8s rollout will happen soon\"}" > mattermost.json @@ -36,8 +36,10 @@ jobs: MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} PAYLOAD: |- {"text":"There is a new [escolalms/api:develop](https://hub.docker.com/r/escolalms/api/tags?page=1&name=develop) image built. k8s rollout will happen soon"} - - - name: Send webook to hooks to rollout all devs on k8s + + - name: Send webook to hooks to rollout all devs on k8s uses: distributhor/workflow-webhook@v3 + with: + webhook_url: ${{ secrets.K8S_WEBHOOK_URL_API_DEVELOP }} env: webhook_url: ${{ secrets.K8S_WEBHOOK_URL_API_DEVELOP }} diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b7a4591d..e3cb6af3 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -11,7 +11,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: - platforms: 'arm64,arm' + platforms: "arm64,arm" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to DockerHub @@ -26,7 +26,7 @@ jobs: tags: escolalms/api:${{github.ref_name}}, escolalms/api:latest platforms: linux/amd64,linux/arm64 - name: create release note - run: ./docker/release_note.sh + run: ./docker/release_note.sh - name: Update GitHub Release uses: tubone24/update_release@v1.3.1 env: @@ -35,7 +35,6 @@ jobs: is_append_body: true body_path: ./result.md - - name: Create the Mattermost Message run: | echo "{\"text\":\"There is a new version ${{ github.ref_name }} [escolalms/api:latest](https://hub.docker.com/r/escolalms/api/tags?page=1&name=latest) image built. k8s rollout will happen soon\"}" > mattermost.json @@ -45,8 +44,7 @@ jobs: PAYLOAD: |- {"text":"There is a new version ${{ github.ref_name }} [escolalms/api:latest](https://hub.docker.com/r/escolalms/api/tags?page=1&name=latest) image built. k8s rollout will happen soon"} - - - name: Send webook to hooks to rollout all devs on k8s + - name: Send webook to hooks to rollout all devs on k8s uses: distributhor/workflow-webhook@v3 - env: + with: webhook_url: ${{ secrets.K8S_WEBHOOK_URL_API_LATEST }} diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 55a55665..c0454096 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -156,7 +156,7 @@ jobs: phpunit-postgres-php83: runs-on: ubuntu-latest container: - image: escolalms/php:8.3-alpine + image: escolalms/php:8.3-bookworm services: postgres: diff --git a/.gitignore b/.gitignore index c545017b..5e9675ad 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,6 @@ caddy/ docker-compose.saas.yml -inited \ No newline at end of file +inited + +k6 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6575b53b..00024955 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ EXPOSE 9000 COPY / /var/www/html RUN \ cp docker/conf/supervisor/supervisord.conf /etc/supervisord.conf \ - && cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \ + && cp docker/conf/php/escolalms-custom-php.ini /usr/local/etc/php/conf.d/escolalms-custom-php.ini \ && cp docker/conf/php/php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf -RUN composer install --no-scripts +RUN composer install --no-scripts --no-dev CMD /var/www/html/init.sh diff --git a/Dockerfile.develop b/Dockerfile.develop index 6575b53b..9c584acc 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -2,11 +2,13 @@ FROM escolalms/php:8.3-alpine WORKDIR /var/www/html EXPOSE 9000 COPY / /var/www/html +RUN pecl install excimer RUN \ cp docker/conf/supervisor/supervisord.conf /etc/supervisord.conf \ - && cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \ + && cp docker/conf/php/escolalms-custom-php.ini /usr/local/etc/php/conf.d/escolalms-custom-php.ini \ + && cp docker/conf/php/escolalms-custom-develop-php.ini /usr/local/etc/php/conf.d/escolalms-custom-develop-php.ini \ && cp docker/conf/php/php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf -RUN composer install --no-scripts +RUN composer install --no-scripts --no-dev CMD /var/www/html/init.sh diff --git a/docker-compose.yml b/docker-compose.yml index 45088141..dca2b6e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: # command: sleep infinity build: context: . - dockerfile: Dockerfile + dockerfile: Dockerfile.develop environment: - LARAVEL_APP_NAME=Wellms - LARAVEL_APP_ENV=local diff --git a/docker/conf/php/escolalms-custom-develop-php.ini b/docker/conf/php/escolalms-custom-develop-php.ini new file mode 100644 index 00000000..4766504f --- /dev/null +++ b/docker/conf/php/escolalms-custom-develop-php.ini @@ -0,0 +1,8 @@ + + + +[PHP] + + + +extension=excimer.so diff --git a/docker/conf/php/xxx-devilbox-default-php.ini b/docker/conf/php/escolalms-custom-php.ini similarity index 53% rename from docker/conf/php/xxx-devilbox-default-php.ini rename to docker/conf/php/escolalms-custom-php.ini index 5a5f6cdb..7b07bfe7 100644 --- a/docker/conf/php/xxx-devilbox-default-php.ini +++ b/docker/conf/php/escolalms-custom-php.ini @@ -42,6 +42,61 @@ log_errors = On html_errors = On + +output_buffering = 0 + +realpath_cache_size = 256k +realpath_cache_ttl = 120 + +opcache.consistency_checks=0 +opcache.dups_fix=Off +opcache.enable=On +opcache.enable_cli=Off +opcache.enable_file_override=Off +opcache.file_cache_consistency_checks=On +opcache.file_cache_only=Off +opcache.file_update_protection=2 +opcache.force_restart_timeout=180 +opcache.huge_code_pages=Off +opcache.interned_strings_buffer=8 +opcache.jit=tracing=tracing +opcache.jit_bisect_limit=0 +opcache.jit_blacklist_root_trace=16 +opcache.jit_blacklist_side_trace=8 +opcache.jit_buffer_size=0 +opcache.jit_debug=0 +opcache.jit_hot_func=127=127 +opcache.jit_hot_loop=64=64 +opcache.jit_hot_return=8 +opcache.jit_hot_side_exit=8 +opcache.jit_max_exit_counters=8192 +opcache.jit_max_loop_unrolls=8 +opcache.jit_max_polymorphic_calls=2 +opcache.jit_max_recursive_calls=2 +opcache.jit_max_recursive_returns=2 +opcache.jit_max_root_traces=1024 +opcache.jit_max_side_traces=128 +opcache.jit_prof_threshold=0.005=0.005 +opcache.lockfile_path=/tmp=/tmp +opcache.log_verbosity_level=1=1 +opcache.max_accelerated_files=10000=10000 +opcache.max_file_size=0 +opcache.max_wasted_percentage=5=5 +opcache.memory_consumption=128 +opcache.opt_debug_level=0 +opcache.optimization_level=0x7FFEBFFF + +opcache.protect_memory=Off +opcache.record_warnings=Off +opcache.revalidate_freq=2 +opcache.revalidate_path=Off +opcache.save_comments=On +opcache.use_cwd=On +opcache.validate_permission=Off +opcache.validate_root=Off +opcache.validate_timestamps=On + + ; Xdebug settings ; uncomment below ; MacOS add host with `sudo ifconfig lo0 alias 10.254.254.254` @@ -64,4 +119,4 @@ html_errors = On ;xdebug.client_host=10.254.254.254 ;xdebug.discover_client_host=1 -extension=excimer.so +;extension=excimer.so diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100755 index 00000000..5a4a69e2 --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + + + +### +### Startup +### +echo "info" "Starting Wellms" +exec "${@}"