]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5851 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 6 May 2023 12:45:35 +0000 (14:45 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 6 May 2023 12:45:35 +0000 (14:45 +0200)
12 files changed:
.docker/config/php.ini [deleted file]
.docker/config/php/fpm.conf [new file with mode: 0644]
.docker/config/php/php.ini [new file with mode: 0644]
.docker/docker-compose.yml
.docker/images/php-dev/Dockerfile
.docker/images/php-dev/overrides.conf [deleted file]
.docker/images/php-dev/startup [deleted file]
.docker/images/php/Dockerfile
.docker/images/php/overrides.conf [deleted file]
.docker/images/php/startup [deleted file]
.docker/update
bin/startup [new file with mode: 0644]

diff --git a/.docker/config/php.ini b/.docker/config/php.ini
deleted file mode 100644 (file)
index c0ef7ab..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-upload_max_filesize = 8G
-post_max_size = 8G
-error_log = /proc/self/fd/2
-log_errors = 1
-memory_limit = 12G
-max_input_vars = 1000000
diff --git a/.docker/config/php/fpm.conf b/.docker/config/php/fpm.conf
new file mode 100644 (file)
index 0000000..4a99e3e
--- /dev/null
@@ -0,0 +1,37 @@
+[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/1
+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 = 160
+pm.start_servers = 48
+pm.min_spare_servers = 40
+pm.max_spare_servers = 80
+pm.max_requests = 1000
diff --git a/.docker/config/php/php.ini b/.docker/config/php/php.ini
new file mode 100644 (file)
index 0000000..c0ef7ab
--- /dev/null
@@ -0,0 +1,6 @@
+upload_max_filesize = 8G
+post_max_size = 8G
+error_log = /proc/self/fd/2
+log_errors = 1
+memory_limit = 12G
+max_input_vars = 1000000
index 0f7f3f45c2866627ad4088c61cfe6e370479c321..fdaca9db69ca076220b0a092b45f3a63594096bf 100644 (file)
@@ -1,15 +1,18 @@
 version: '3.1'
 services:
-  webserver:
-    container_name: fluidbook-toolbox-httpd
-    build: /home/toolbox/www/.docker/images/httpd
+  php-fpm:
+    container_name: fluidbook-toolbox
+    build: /home/toolbox/www/.docker/images/php
     working_dir: /application
+    hostname: fluidbook-toolbox
+    environment:
+      TZ: Europe/Paris
+      HOME: /application
+      NODE_PATH: /usr/lib/node_modules
     volumes:
-      # Config
-      - '/home/toolbox/www/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
       # Files
-      - '/home/extranet/share:/application/share'
-      - '/home/toolbox/www:/application'
+      - '/home/toolbox/www/:/application/'
+      - '/home/extranet/share/:/application/share/'
       - '/data/toolbox/storage/app/public/:/application/public/storage/'
       - '/data/toolbox/storage/:/application/storage/'
       - '/data/extranet/ftp/:/application/ftp/'
@@ -18,28 +21,11 @@ services:
       - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/'
       - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/'
       - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/'
-      - '/home/extranet:/home/extranet'
-      - '/data/extranet:/data/extranet'
-      - '/mnt:/mnt'
-    ports:
-      - '37126:80'
-    environment:
-      VIRTUAL_HOST: toolbox.fluidbook.com
-      LETSENCRYPT_HOST: toolbox.fluidbook.com
-    networks:
-      - fluidbook-toolbox
-    restart: unless-stopped
-
-  php-fpm:
-    container_name: fluidbook-toolbox
-    build: /home/toolbox/www/.docker/images/php
-    working_dir: /application
-    hostname: fluidbook-toolbox
-    environment:
-      TZ: Europe/Paris
-      HOME: /application
-      NODE_PATH: /usr/lib/node_modules
-    volumes:
+      - '/home/extranet/:/home/extranet/'
+      - '/data/extranet/:/data/extranet/'
+      - '/mnt/:/mnt/'
+      # Startup
+      - '/home/toolbox/www/bin/startup:/usr/bin/startup'
       # SSH
       - '/home/toolbox/www/.docker/config/ssh/root/:/root/.ssh/'
       - '/home/toolbox/www/.docker/config/ssh/user/:/application/.ssh/'
@@ -73,12 +59,30 @@ services:
       # Rclone
       - '/home/toolbox/www/.docker/config/rclone.conf:/application/.config/rclone/rclone.conf'
       # PHP
-      - '/home/toolbox/www/.docker/config/php.ini:/etc/php/8.2/fpm/conf.d/99-overrides.ini'
+      - '/home/toolbox/www/.docker/config/php/php.ini:/etc/php/8.2/fpm/conf.d/99-overrides.ini'
+      - '/home/toolbox/www/.docker/config/php/fpm.conf:/etc/php/8.2/fpm/pool.d/z-overrides.conf'
       # ENV
       - '/home/toolbox/www/.env.prod:/application/.env'
+    ports:
+      - '58744:8123'
+      - '58745:22'
+    networks:
+      - fluidbook-toolbox
+      - fluidbook-processfarm
+    restart: unless-stopped
+
+
+  webserver:
+    container_name: fluidbook-toolbox-httpd
+    build: /home/toolbox/www/.docker/images/httpd
+    working_dir: /application
+    volumes:
       # Files
-      - '/home/extranet/share:/application/share'
-      - '/home/toolbox/www:/application'
+      - '/home/toolbox/www/:/application/'
+      - '/home/extranet/:/home/extranet/'
+      - '/data/extranet/:/data/extranet/'
+      - '/mnt/:/mnt/'
+      - '/home/extranet/share/:/application/share/'
       - '/data/toolbox/storage/app/public/:/application/public/storage/'
       - '/data/toolbox/storage/:/application/storage/'
       - '/data/extranet/ftp/:/application/ftp/'
@@ -87,16 +91,18 @@ services:
       - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/'
       - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/'
       - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/'
-      - '/home/extranet:/home/extranet'
-      - '/data/extranet:/data/extranet'
-      - '/mnt:/mnt'
+      # Config
+      - '/home/toolbox/www/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
     ports:
-      - '58744:8123'
-      - '58745:22'
+      - '37126:80'
+    environment:
+      VIRTUAL_HOST: toolbox.fluidbook.com
+      LETSENCRYPT_HOST: toolbox.fluidbook.com
     networks:
       - fluidbook-toolbox
-      - fluidbook-processfarm
     restart: unless-stopped
+
+
   adminer:
     image: adminer:latest
     container_name: fluidbook-toolbox-adminer
index c06fa2ff1b6446215dc3966982455f75b7d6c97f..2348d6a96385abcb7b69c1b07bf21f97bb492348 100644 (file)
@@ -5,6 +5,8 @@ WORKDIR "/application"
 # Fixes some weird terminal issues such as broken clear / CTRL+L
 ENV TERM=linux
 
+WORKDIR "/application"
+
 # Ensure apt doesn't ask questions when installing stuff
 ENV DEBIAN_FRONTEND=noninteractive
 
@@ -93,7 +95,7 @@ RUN groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1001 too
 # PHP-FPM packages need a nudge to make them docker-friendly
 COPY overrides.conf /etc/php/8.2/fpm/pool.d/z-overrides.conf
 
-COPY startup /usr/bin/startup
+COPY --chmod=0755 startup /usr/bin/startup
 CMD exec /usr/bin/startup
 
 # Open up fcgi port
diff --git a/.docker/images/php-dev/overrides.conf b/.docker/images/php-dev/overrides.conf
deleted file mode 100644 (file)
index 4a99e3e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-[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/1
-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 = 160
-pm.start_servers = 48
-pm.min_spare_servers = 40
-pm.max_spare_servers = 80
-pm.max_requests = 1000
diff --git a/.docker/images/php-dev/startup b/.docker/images/php-dev/startup
deleted file mode 100644 (file)
index 3dc5848..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Set file rights
-umask 0000
-chmod -R 777 /tmp
-
-chown -R root:root /etc/sudoers.d
-chown -R toolbox:www-data /application/storage/framework
-chmod 755 /etc/ssh/*.d
-chmod 600 /etc/ssh/*_key
-chmod 750 /application
-chmod 600 /application/.ssh/id_rsa
-chmod 700 /application/.ssh/
-chmod 600 /application/.ssh/authorized_keys2
-chmod 600 /root/.ssh/id_rsa
-chmod 700 /root/.ssh/
-chmod 600 /root/.ssh/authorized_keys2
-
-# Rsyslog
-start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n
-
-# SSH Server
-/usr/sbin/service ssh start
-
-# Supervisor
-/usr/sbin/service supervisor start
-
-# Cron
-chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start
-
-# Set user password
-chpasswd < /root/passwords
-
-# Launch monit
-chmod -R 700 /etc/monit;chown -R root:root /etc/monit;/usr/bin/monit
-chown -R root:root /etc/monit && /usr/bin/monit
-
-# Launch PHP
-/usr/sbin/php-fpm8.2 -O
index c06fa2ff1b6446215dc3966982455f75b7d6c97f..79cf573967676453bd3bce6b5b93da71ce1394bd 100644 (file)
@@ -93,7 +93,6 @@ RUN groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1001 too
 # PHP-FPM packages need a nudge to make them docker-friendly
 COPY overrides.conf /etc/php/8.2/fpm/pool.d/z-overrides.conf
 
-COPY startup /usr/bin/startup
 CMD exec /usr/bin/startup
 
 # Open up fcgi port
diff --git a/.docker/images/php/overrides.conf b/.docker/images/php/overrides.conf
deleted file mode 100644 (file)
index 4a99e3e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-[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/1
-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 = 160
-pm.start_servers = 48
-pm.min_spare_servers = 40
-pm.max_spare_servers = 80
-pm.max_requests = 1000
diff --git a/.docker/images/php/startup b/.docker/images/php/startup
deleted file mode 100644 (file)
index 3dc5848..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Set file rights
-umask 0000
-chmod -R 777 /tmp
-
-chown -R root:root /etc/sudoers.d
-chown -R toolbox:www-data /application/storage/framework
-chmod 755 /etc/ssh/*.d
-chmod 600 /etc/ssh/*_key
-chmod 750 /application
-chmod 600 /application/.ssh/id_rsa
-chmod 700 /application/.ssh/
-chmod 600 /application/.ssh/authorized_keys2
-chmod 600 /root/.ssh/id_rsa
-chmod 700 /root/.ssh/
-chmod 600 /root/.ssh/authorized_keys2
-
-# Rsyslog
-start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n
-
-# SSH Server
-/usr/sbin/service ssh start
-
-# Supervisor
-/usr/sbin/service supervisor start
-
-# Cron
-chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start
-
-# Set user password
-chpasswd < /root/passwords
-
-# Launch monit
-chmod -R 700 /etc/monit;chown -R root:root /etc/monit;/usr/bin/monit
-chown -R root:root /etc/monit && /usr/bin/monit
-
-# Launch PHP
-/usr/sbin/php-fpm8.2 -O
index 4e68f34f5a68db38f02489d053c8b2af0f57cd4e..8edf7021fc90b3df6c70cda18ec1df23798f4e87 100644 (file)
@@ -1,8 +1,9 @@
 #!/bin/sh
 cd /docker/fluidbook-toolbox
+/home/toolbox/www/scripts/fixrights
 chown root:root /home/toolbox/www/.docker/config/cron/host;ln -sf /home/toolbox/www/.docker/config/cron/host /etc/cron.d/toolbox
 docker network create fluidbook-toolbox
 docker compose down
-docker compose up -d
-docker exec -it fluidbook-toolbox /application/scripts/update
+docker -D -l debug compose  up -d
 /home/toolbox/www/scripts/fixrights
+docker exec -it fluidbook-toolbox /application/scripts/update
diff --git a/bin/startup b/bin/startup
new file mode 100644 (file)
index 0000000..3dc5848
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Set file rights
+umask 0000
+chmod -R 777 /tmp
+
+chown -R root:root /etc/sudoers.d
+chown -R toolbox:www-data /application/storage/framework
+chmod 755 /etc/ssh/*.d
+chmod 600 /etc/ssh/*_key
+chmod 750 /application
+chmod 600 /application/.ssh/id_rsa
+chmod 700 /application/.ssh/
+chmod 600 /application/.ssh/authorized_keys2
+chmod 600 /root/.ssh/id_rsa
+chmod 700 /root/.ssh/
+chmod 600 /root/.ssh/authorized_keys2
+
+# Rsyslog
+start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n
+
+# SSH Server
+/usr/sbin/service ssh start
+
+# Supervisor
+/usr/sbin/service supervisor start
+
+# Cron
+chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start
+
+# Set user password
+chpasswd < /root/passwords
+
+# Launch monit
+chmod -R 700 /etc/monit;chown -R root:root /etc/monit;/usr/bin/monit
+chown -R root:root /etc/monit && /usr/bin/monit
+
+# Launch PHP
+/usr/sbin/php-fpm8.2 -O