├── Dockerfile ├── LICENSE ├── README.md ├── default ├── entrypoint.sh └── index.html /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | 5 | ARG PHP_VERSION_MOLECULE=7.4 6 | ARG PHP_VERSION=php${PHP_VERSION_MOLECULE} 7 | ARG PHP_DIR=php/${PHP_VERSION_MOLECULE} 8 | 9 | RUN \ 10 | apt-get -y update ; \ 11 | apt-get -y install \ 12 | gnupg2 \ 13 | nano \ 14 | wget \ 15 | unzip \ 16 | mariadb-server \ 17 | nginx \ 18 | ssl-cert \ 19 | php-pear \ 20 | ${PHP_VERSION}-fpm \ 21 | ${PHP_VERSION}-mysql \ 22 | ${PHP_VERSION}-cgi \ 23 | ${PHP_VERSION}-mbstring \ 24 | ${PHP_VERSION}-gd \ 25 | ${PHP_VERSION}-xsl \ 26 | ${PHP_VERSION}-curl \ 27 | ${PHP_VERSION}-intl \ 28 | ${PHP_VERSION}-soap \ 29 | ${PHP_VERSION}-zip \ 30 | ${PHP_VERSION}-bz2 \ 31 | ${PHP_VERSION}-sqlite3 \ 32 | ${PHP_VERSION}-xml \ 33 | ${PHP_VERSION}-xmlrpc 34 | 35 | ADD default /etc/nginx/sites-available/ 36 | 37 | RUN \ 38 | sed -i s/'max_execution_time = 30'/'max_execution_time = 3600'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 39 | sed -i s/'upload_max_filesize = 2M'/'upload_max_filesize = 1G'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 40 | sed -i s/'memory_limit = 128M'/'memory_limit = 256M'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 41 | sed -i s/'post_max_size = 8M'/'post_max_size = 1G'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 42 | sed -i s/';date.timezone ='/'date.timezone = Europe\/Paris'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 43 | sed -i s/';max_input_vars = 1000'/'max_input_vars = 100000'/ /etc/${PHP_DIR}/fpm/php.ini ; \ 44 | sed -i s/'max_allowed_packet\t= 16M'/'max_allowed_packet\t= 1G'/ /etc/mysql/my.cnf ; \ 45 | sed -i s/'index.nginx-debian.html'/'index.php'/ /etc/nginx/sites-available/default ; \ 46 | sed -i s/'server_name _;'/"server_name _;\n\n\tlocation ~ \\.php$ {\n\t\tinclude snippets\/fastcgi-php.conf;\n\t\tfastcgi_pass unix:\/var\/run\/php\/php${PHP_VERSION_MOLECULE}-fpm.sock;\n\t}"/ /etc/nginx/sites-available/default 47 | 48 | ADD index.html /var/www/html/ 49 | 50 | WORKDIR /var/www/html 51 | 52 | RUN wget \ 53 | https://forge.sigb.net/attachments/download/4131/pmb7.4.7.zip \ 54 | ; \ 55 | unzip pmb7*.zip ; rm pmb7*.zip ; chown -R www-data:www-data . 56 | 57 | ADD entrypoint.sh /usr/local/bin/ 58 | 59 | EXPOSE 80 60 | 61 | VOLUME ["/var/lib/mysql","/etc/pmb"] 62 | 63 | CMD ["bash", "/usr/local/bin/entrypoint.sh"] 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 jperon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pmb 2 | 3 | Dockerfile pour une installation facile et sommaire de [PMB](http://www.sigb.net/) 4 | 5 | # NOTA BENE 6 | 7 | Pour une installation plus propre de PMB, référez-vous à [ce dépôt](https://github.com/mqu/pmb-ils/). 8 | 9 | 10 | # Lancement 11 | 12 | Il suffit de lancer, par exemple, la commande : 13 | `docker run --name pmb -v pmb_data:/var/lib/mysql -v pmb_cfg:/etc/pmb -p 8080:80 -d jperon/pmb` 14 | 15 | Pointez alors votre navigateur à l'adresse suivante : 16 | http://localhost:8080/pmb/tables/install.php 17 | 18 | Suivez alors les instructions ; pour la base de données mysql, les identifiants sont : 19 | - nom d'utilisateur : `admin` ; 20 | - mot de passe : `admin`. 21 | 22 | Pour le reste, référez-vous à la documentation de PMB. 23 | 24 | 25 | # Mise-à-jour 26 | 27 | Lorsqu'une nouvelle version est disponible, vous pouvez effectuer la mise-à-jour comme suit : 28 | 29 | ``` 30 | docker stop pmb ; docker rm pmb 31 | docker pull jperon/pmb 32 | docker run --name pmb -v pmb_data:/var/lib/mysql -v pmb_cfg:/etc/pmb -p 8080:80 -d jperon/pmb 33 | ``` 34 | 35 | Vos données et vos paramètres seront conservés (dans la mesure, évidemment, de leur compatibilité 36 | avec la nouvelle version !). 37 | -------------------------------------------------------------------------------- /default: -------------------------------------------------------------------------------- 1 | server { 2 | include snippets/snakeoil.conf; 3 | listen 80 default_server; 4 | listen [::]:80 default_server; 5 | 6 | listen 443 ssl default_server; 7 | listen [::]:443 ssl default_server; 8 | 9 | root /var/www/html; 10 | 11 | index index.html index.htm index.php; 12 | 13 | server_name _; 14 | 15 | location / { 16 | try_files $uri $uri/ =404; 17 | } 18 | 19 | location ~ \.php$ { 20 | include snippets/fastcgi-php.conf; 21 | 22 | fastcgi_pass unix:/run/php/php7.3-fpm.sock; 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function initialiser_db { 4 | service mariadb stop 5 | mysql_install_db --user=mysql 6 | service mariadb start --character-set-server=utf8 --collation-server=utf8_unicode_ci --sql_mode=NO_AUTO_CREATE_USER --key_buffer_size=1000000000 --join_buffer_size=4000000 7 | echo "CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin'; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;" | mysql -uroot 8 | } 9 | 10 | function initialiser_parametres { 11 | mkdir /etc/pmb 12 | touch /etc/pmb/db_param.inc.php 13 | chown www-data:www-data /etc/pmb/db_param.inc.php 14 | ln -s /etc/pmb/db_param.inc.php /var/www/html/pmb/includes/db_param.inc.php 15 | ln -s /etc/pmb/db_param.inc.php /var/www/html/pmb/opac_css/includes/opac_db_param.inc.php 16 | } 17 | 18 | ls /var/www/html/pmb/includes/db_param.inc.php || initialiser_parametres 19 | service mariadb start --character-set-server=utf8 --collation-server=utf8_unicode_ci --key_buffer_size=1000000000 --join_buffer_size=4000000 --sql_mode=NO_AUTO_CREATE_USER 20 | echo '' | mysql -uadmin -padmin || initialiser_db 21 | service php7.4-fpm start 22 | nginx -g 'daemon off;' 23 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 9 |