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
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule xsendfile_module /usr/lib/apache2/modules/mod_xsendfile.so
+
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://fluidbook-toolbox:9000/application/public/$1" timeout=1800
+XSendFile on
+XSendFilePath /data1/extranet
+XSendFilePath /application
+XSendFilePath /home/extranet
+
+
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
services:
webserver:
container_name: fluidbook-toolbox-httpd
- image: 'httpd:alpine'
+ build: /data1/extranet/toolbox/.docker/images/httpd
working_dir: /application
volumes:
- - '/data1/extranet/toolbox/public/:/usr/local/apache2/htdocs/'
- - '/data1/extranet/toolbox/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
+ - '/data1/extranet/toolbox/:/application/'
+ - '/data1/extranet/toolbox/public/:/usr/local/apache2/htdocs/'
+ - '/data1/extranet/toolbox/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
ports:
- '37126:80'
environment:
php-fpm:
container_name: fluidbook-toolbox
- build: /data1/extranet/toolbox/.docker/image
+ build: /data1/extranet/toolbox/.docker/images/php
working_dir: /application
volumes:
- '/data1/extranet/toolbox/.docker/config/ssh/:/root/.ssh/'
+++ /dev/null
-############################################
-# PHPDocker.io PHP 8.1 / CLI and FPM image #
-############################################
-
-FROM ubuntu:jammy AS cli
-
-WORKDIR "/application"
-
-# Fixes some weird terminal issues such as broken clear / CTRL+L
-ENV TERM=linux
-
-# Ensure apt doesn't ask questions when installing stuff
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Install Ondrej repos for Ubuntu jammy, PHP, composer and selected extensions - better selection than
-# the distro's packages
-RUN apt-get update && apt-get install -y --no-install-recommends gnupg \
- && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \
- && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
- && apt-get update \
- && apt-get -y --no-install-recommends install \
- ca-certificates \
- curl \
- unzip \
- git \
- php8.1-apcu \
- php8.1-cli \
- php8.1-curl \
- php8.1-mbstring \
- php8.1-opcache \
- php8.1-readline \
- php8.1-xml \
- php8.1-zip \
- php8.1-bz2 \
- php8.1-gd \
- php8.1-igbinary \
- php8.1-imap \
- php8.1-imagick \
- php8.1-intl \
- php8.1-memcached \
- php8.1-mysql \
- php8.1-redis \
- php8.1-soap \
- php8.1-ssh2 \
- php8.1-tidy \
- php8.1-xsl \
- php8.1-curl \
- php8.1-mcrypt \
- less nano wget bash lynx
-
-COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
-
-CMD ["php", "-a"]
-
-# If you'd like to be able to use this container on a docker-compose environment as a quiescent PHP CLI container
-# you can /bin/bash into, override CMD with the following - bear in mind that this will make docker-compose stop
-# slow on such a container, docker-compose kill might do if you're in a hurry
-# CMD ["tail", "-f", "/dev/null"]
-
-FROM cli AS fpm
-
-# Install FPM
-RUN apt-get update \
- && apt-get -y --no-install-recommends install php8.1-fpm
-
-STOPSIGNAL SIGQUIT
-
-# 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 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 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
-CMD exec /usr/bin/startup
-
-# Open up fcgi port
-EXPOSE 9000
+++ /dev/null
-[global]
-; Override default pid file
-pid = /run/php-fpm.pid
-
-; Avoid logs being sent to syslog
-error_log = /proc/self/fd/2
-
-; Set this to php default's max_execution_time to allow children to stop gracefully when fpm is commanded to stop
-; This helps avoiding 502's
-process_control_timeout = 30
-
-; Do not daemonize (eg send process to the background)
-daemonize = no
-
-[www]
-; Access from webserver container is via network, not socket file
-listen = [::]:9000
-
-; Redirect logs to stdout - FPM closes /dev/std* on startup
-access.log = /proc/self/fd/2
-catch_workers_output = yes
-
-; Remove "pool www" decoration from log output (older phpdocker.io containers for php use sed for this)
-decorate_workers_output = no
-
-; Required to allow config-by-environment
-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
+++ /dev/null
-#!/bin/sh
-
-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
--- /dev/null
+FROM httpd
+RUN apt-get update && apt-get install -y --no-install-recommends nano less bash libapache2-mod-xsendfile
+RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
--- /dev/null
+############################################
+# PHPDocker.io PHP 8.1 / CLI and FPM image #
+############################################
+
+FROM ubuntu:jammy AS cli
+
+WORKDIR "/application"
+
+# Fixes some weird terminal issues such as broken clear / CTRL+L
+ENV TERM=linux
+
+# Ensure apt doesn't ask questions when installing stuff
+ENV DEBIAN_FRONTEND=noninteractive
+
+# Install Ondrej repos for Ubuntu jammy, PHP, composer and selected extensions - better selection than
+# the distro's packages
+RUN apt-get update && apt-get install -y --no-install-recommends gnupg \
+ && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \
+ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
+ && apt-get update \
+ && apt-get -y --no-install-recommends install \
+ ca-certificates \
+ curl \
+ unzip \
+ git \
+ php8.1-apcu \
+ php8.1-cli \
+ php8.1-curl \
+ php8.1-mbstring \
+ php8.1-opcache \
+ php8.1-readline \
+ php8.1-xml \
+ php8.1-zip \
+ php8.1-bz2 \
+ php8.1-gd \
+ php8.1-igbinary \
+ php8.1-imap \
+ php8.1-imagick \
+ php8.1-intl \
+ php8.1-memcached \
+ php8.1-mysql \
+ php8.1-redis \
+ php8.1-soap \
+ php8.1-ssh2 \
+ php8.1-tidy \
+ php8.1-xsl \
+ php8.1-curl \
+ php8.1-mcrypt \
+ less nano wget bash lynx
+
+COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
+
+CMD ["php", "-a"]
+
+# If you'd like to be able to use this container on a docker-compose environment as a quiescent PHP CLI container
+# you can /bin/bash into, override CMD with the following - bear in mind that this will make docker-compose stop
+# slow on such a container, docker-compose kill might do if you're in a hurry
+# CMD ["tail", "-f", "/dev/null"]
+
+FROM cli AS fpm
+
+# Install FPM
+RUN apt-get update \
+ && apt-get -y --no-install-recommends install php8.1-fpm
+
+STOPSIGNAL SIGQUIT
+
+# 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 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 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
+CMD exec /usr/bin/startup
+
+# Open up fcgi port
+EXPOSE 9000
--- /dev/null
+[global]
+; Override default pid file
+pid = /run/php-fpm.pid
+
+; Avoid logs being sent to syslog
+error_log = /proc/self/fd/2
+
+; Set this to php default's max_execution_time to allow children to stop gracefully when fpm is commanded to stop
+; This helps avoiding 502's
+process_control_timeout = 30
+
+; Do not daemonize (eg send process to the background)
+daemonize = no
+
+[www]
+; Access from webserver container is via network, not socket file
+listen = [::]:9000
+
+; Redirect logs to stdout - FPM closes /dev/std* on startup
+access.log = /proc/self/fd/2
+catch_workers_output = yes
+
+; Remove "pool www" decoration from log output (older phpdocker.io containers for php use sed for this)
+decorate_workers_output = no
+
+; Required to allow config-by-environment
+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
--- /dev/null
+#!/bin/sh
+
+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
{
$currenttime = microtime(true);
if (null === $this->logfp) {
- $this->logfp = fopen('/var/log/extranet/htmlconversions/' . $this->book_id . '.log', 'w+');
+ $this->logfp = fopen(Files::mkdir(storage_path('logs/htmlconversions')) . $this->book_id . '.log', 'w+');
}
if (null === $this->logtime) {
$this->logtime = $currenttime;