]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5418 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 27 Aug 2022 12:58:29 +0000 (14:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 27 Aug 2022 12:58:29 +0000 (14:58 +0200)
15 files changed:
.docker/config/crontab [new file with mode: 0644]
.docker/config/php.ini [new file with mode: 0644]
.docker/config/supervisor/default-worker.conf [new file with mode: 0644]
.docker/config/supervisor/download-worker.conf [new file with mode: 0644]
.docker/config/supervisor/fluidbook-process-worker.conf [new file with mode: 0644]
.docker/config/supervisor/theme-worker.conf [new file with mode: 0644]
.docker/docker-compose.yml
.docker/image/Dockerfile
.docker/image/overrides.conf
.docker/image/php-ini-overrides.ini [deleted file]
.docker/image/startup
README.md [deleted file]
app/Jobs/FluidbookCompiler.php
app/Providers/AppServiceProvider.php
config/cache.php

diff --git a/.docker/config/crontab b/.docker/config/crontab
new file mode 100644 (file)
index 0000000..d8ce4b2
--- /dev/null
@@ -0,0 +1,7 @@
+MAILTO=sysadmin@cubedesigners.com
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+* * * * *   runuser -l toolbox -c '/usr/bin/php /application/artisan schedule:run' > /proc/1/fd/1 2>/proc/1/fd/2
+* * * * *   echo 'Test cron' > /proc/1/fd/1 2>/proc/1/fd/2
+20 5 * * *  /application/scripts/restartworkers > /proc/1/fd/1 2>/proc/1/fd/2
diff --git a/.docker/config/php.ini b/.docker/config/php.ini
new file mode 100644 (file)
index 0000000..702f901
--- /dev/null
@@ -0,0 +1,5 @@
+upload_max_filesize = 8G
+post_max_size = 8G
+error_log = /proc/self/fd/2
+log_errors = 1
+memory_limit = 12G
diff --git a/.docker/config/supervisor/default-worker.conf b/.docker/config/supervisor/default-worker.conf
new file mode 100644 (file)
index 0000000..4228ba9
--- /dev/null
@@ -0,0 +1,11 @@
+[program:default-worker]
+process_name=%(program_name)s_%(process_num)02d
+command=php /application/artisan queue:work --queue=default --timeout=0
+autostart=true
+autorestart=true
+user=toolbox
+group=www-data
+numprocs=3
+redirect_stderr=true
+stdout_logfile=/proc/self/fd/2
+stopwaitsecs=3600
diff --git a/.docker/config/supervisor/download-worker.conf b/.docker/config/supervisor/download-worker.conf
new file mode 100644 (file)
index 0000000..b3031ef
--- /dev/null
@@ -0,0 +1,11 @@
+[program:download-worker]
+process_name=%(program_name)s_%(process_num)02d
+command=php /application/artisan queue:work --queue=download --timeout=0
+autostart=true
+autorestart=true
+user=toolbox
+group=www-data
+numprocs=6
+redirect_stderr=true
+stdout_logfile=/proc/self/fd/2
+stopwaitsecs=3600
diff --git a/.docker/config/supervisor/fluidbook-process-worker.conf b/.docker/config/supervisor/fluidbook-process-worker.conf
new file mode 100644 (file)
index 0000000..5a72019
--- /dev/null
@@ -0,0 +1,11 @@
+[program:process-worker]
+process_name=%(program_name)s_%(process_num)02d
+command=php /application/artisan queue:work --queue=fluidbookprocess --timeout=0
+autostart=true
+autorestart=true
+user=toolbox
+group=www-data
+numprocs=48
+redirect_stderr=true
+stdout_logfile=/proc/self/fd/2
+stopwaitsecs=3600
diff --git a/.docker/config/supervisor/theme-worker.conf b/.docker/config/supervisor/theme-worker.conf
new file mode 100644 (file)
index 0000000..b1421bc
--- /dev/null
@@ -0,0 +1,11 @@
+[program:theme-worker]
+process_name=%(program_name)s_%(process_num)02d
+command=php /application/artisan queue:work --queue=theme --timeout=0
+autostart=true
+autorestart=true
+user=toolbox
+group=www-data
+numprocs=3
+redirect_stderr=true
+stdout_logfile=/proc/self/fd/2
+stopwaitsecs=3600
index 8370757b432487f31be9eeca68ea5e11978be56f..676732beed20c0ce1a15f99b7061cb59a5aa44b0 100644 (file)
@@ -21,8 +21,8 @@ services:
         build: /data1/extranet/toolbox/.docker/image
         working_dir: /application
         volumes:
-#            - './config/passwd:/etc/passwd'
             - '/data1/extranet/toolbox/.docker/config/ssh/:/root/.ssh/'
+            - '/data1/extranet/toolbox/.docker/config/supervisor/:/etc/supervisor/conf.d/'
             - '/data1/extranet/toolbox/.docker/config/composer/:/root/.config/composer/'
             - '/data1/extranet/toolbox/.docker/config/npm/:/root/.npm/'
             - '/data1/extranet/toolbox/.docker/config/gitconfig:/root/.gitconfig'
@@ -30,7 +30,11 @@ services:
             - '/home/extranet:/home/extranet'
             - '/mnt:/mnt'
             - '/data1/extranet/toolbox:/application'
-            - '/data1/extranet/toolbox/.docker/php-ini-overrides.ini:/etc/php/8.2/fpm/conf.d/99-overrides.ini'
+            - '/data1/extranet/toolbox/.docker/config/php.ini:/etc/php/8.1/fpm/conf.d/99-overrides.ini'
+            - '/data1/extranet/toolbox/.docker/config/crontab:/etc/crontab'
+        tmpfs:
+          - '/tmp:uid=1001,gid=33'
+          - '/application/storage/framework/cache:uid=1001,gid=33'
         networks:
           - fluidbook-toolbox
         restart: unless-stopped
index c9bcb5e4de664104f437091de00b9fef87d7ac17..84b58c3e911fa1d97795cc010e177a376b9aa1f1 100644 (file)
@@ -65,19 +65,27 @@ RUN apt-get update \
 
 STOPSIGNAL SIGQUIT
 
-# PHP-FPM packages need a nudge to make them docker-friendly
-COPY overrides.conf /etc/php/8.1/fpm/pool.d/z-overrides.conf
-
 # Toolbox
 RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs
+
 RUN apt-get -y --no-install-recommends install sudo
-RUN apt-get -y --no-install-recommends install supervisor ssh
+RUN apt-get -y --no-install-recommends install supervisor ssh rsync
 RUN apt-get -y --no-install-recommends install nsis
-RUN apt-get -y --no-install-recommends install default-jre pdftk poppler-utils ghostscript imagemagick
+RUN apt-get -y --no-install-recommends install default-jre pdftk poppler-utils ghostscript imagemagick netpbm libjpeg-turbo8
 RUN apt-get -y --no-install-recommends install zip unzip gzip 7zip
+RUN apt-get -y --no-install-recommends install icoutils fontforge
+RUN apt-get -y --no-install-recommends install ffmpeg python3
+RUN apt-get -y --no-install-recommends install inkscape mupdf-tools
+RUN apt-get -y --no-install-recommends install cron
+
 RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
+RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && chmod a+rx /usr/local/bin/yt-dlp && ln -s /usr/local/bin/yt-dlp /usr/local/bin/youtube-dl
 
 RUN useradd -d /application -g www-data -s /bin/bash -u 1001 toolbox
+RUN npm install --unsafe-perm --global uglify-js less puppeteer
+
+# PHP-FPM packages need a nudge to make them docker-friendly
+COPY overrides.conf /etc/php/8.1/fpm/pool.d/z-overrides.conf
 
 #CMD ["/usr/sbin/php-fpm8.1", "-O" ]
 COPY startup /usr/bin/startup
@@ -85,4 +93,3 @@ CMD exec /usr/bin/startup
 
 # Open up fcgi port
 EXPOSE 9000
-
index 7b16fcd6e41fde3f650d0194a1735b94d0ee0247..5d60f05fb1280ebd3cd13b4064348071498b1c0e 100644 (file)
@@ -28,3 +28,10 @@ clear_env = no
 
 user = 1001
 group = 33
+
+pm = dynamic
+pm.max_children = 80
+pm.start_servers = 24
+pm.min_spare_servers = 20
+pm.max_spare_servers = 40
+pm.max_requests = 1000
diff --git a/.docker/image/php-ini-overrides.ini b/.docker/image/php-ini-overrides.ini
deleted file mode 100644 (file)
index bf24fef..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-upload_max_filesize = 2G
-post_max_size = 2G
index 5678167801b60d3f9564d94e53ff5c38b2e62b1a..d2ec4553172ef1bb7baf9382cfd0840c4a48ffbb 100644 (file)
@@ -1,3 +1,6 @@
 #!/bin/sh
-#/application/bin/restarthome
+
+chmod 0644 /etc/crontab && crontab -u root /etc/crontab
+/usr/sbin/service cron start
+/usr/sbin/service supervisor start
 /usr/sbin/php-fpm8.1 -O
diff --git a/README.md b/README.md
deleted file mode 100644 (file)
index 81f2f62..0000000
--- a/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-<p align="center"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></p>
-
-<p align="center">
-<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
-<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
-<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
-<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
-</p>
-
-## About Laravel
-
-Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
-
-- [Simple, fast routing engine](https://laravel.com/docs/routing).
-- [Powerful dependency injection container](https://laravel.com/docs/container).
-- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
-- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
-- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
-- [Robust background job processing](https://laravel.com/docs/queues).
-- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
-
-Laravel is accessible, powerful, and provides tools required for large, robust applications.
-
-## Learning Laravel
-
-Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
-
-If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
-
-## Laravel Sponsors
-
-We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
-
-- **[Vehikl](https://vehikl.com/)**
-- **[Tighten Co.](https://tighten.co)**
-- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
-- **[64 Robots](https://64robots.com)**
-- **[Cubet Techno Labs](https://cubettech.com)**
-- **[Cyber-Duck](https://cyber-duck.co.uk)**
-- **[British Software Development](https://www.britishsoftware.co)**
-- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
-- **[DevSquad](https://devsquad.com)**
-- [UserInsights](https://userinsights.com)
-- [Fragrantica](https://www.fragrantica.com)
-- [SOFTonSOFA](https://softonsofa.com/)
-- [User10](https://user10.com)
-- [Soumettre.fr](https://soumettre.fr/)
-- [CodeBrisk](https://codebrisk.com)
-- [1Forge](https://1forge.com)
-- [TECPRESSO](https://tecpresso.co.jp/)
-- [Runtime Converter](http://runtimeconverter.com/)
-- [WebL'Agence](https://weblagence.com/)
-- [Invoice Ninja](https://www.invoiceninja.com)
-- [iMi digital](https://www.imi-digital.de/)
-- [Earthlink](https://www.earthlink.ro/)
-- [Steadfast Collective](https://steadfastcollective.com/)
-- [We Are The Robots Inc.](https://watr.mx/)
-- [Understand.io](https://www.understand.io/)
-- [Abdel Elrafa](https://abdelelrafa.com)
-- [Hyper Host](https://hyper.host)
-- [Appoly](https://www.appoly.co.uk)
-- [OP.GG](https://op.gg)
-
-## Contributing
-
-Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
-
-## Code of Conduct
-
-In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
-
-## Security Vulnerabilities
-
-If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
-
-## License
-
-The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
index bf75a7cec004ffd4453c9121afab8e0c6168b496..0fb18c0ae57ffa0857bc8e6e171f976215ce3d8b 100644 (file)
@@ -2765,7 +2765,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
                 if (file_exists($tmp) && filesize($tmp) > 0) {
                     if ($hasNonMin) {
-                        $uglify = new CommandLine('/usr/local/bin/uglifyjs');
+                        $uglify = new CommandLine('uglifyjs');
                         $uglify->setArg('o', $minimized);
                         $uglify->setArg(null, $tmp);
                         $uglify->execute();
@@ -3314,7 +3314,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             // Less files must be copied to temporary directory so they'll
             // have access to the variables generated in book-variables.less
             copy($source_less, $destination_less);
-            $less = new CommandLine('/usr/local/bin/lessc');
+            $less = new CommandLine('lessc');
             $less->setArg(null, $destination_less);
             $less->setArg(null, $destination_css);
             $less->execute();
index ee8ca5bcd8f77d219f29529a9163587235c545d5..9839163f421e892bfa57adaeb252c113ed4cdace 100644 (file)
@@ -23,6 +23,6 @@ class AppServiceProvider extends ServiceProvider
      */
     public function boot()
     {
-        //
+        \Illuminate\Support\Facades\URL::forceScheme('https');
     }
 }
index 46751e627fbddeb7cbef624bfed0e15ac910358b..40001634237574a6c9cabde461d093cf268478b7 100644 (file)
@@ -49,7 +49,7 @@ return [
 
         'file' => [
             'driver' => 'file',
-            'path' => storage_path('framework/cache/data'),
+            'path' => storage_path('framework'),
         ],
 
         'memcached' => [