├── README.md ├── start.sh ├── default ├── update.sh ├── LICENSE ├── Dockerfile └── supervisord.conf /README.md: -------------------------------------------------------------------------------- 1 | # peppermintydocker 2 | Docker container for peppermintywiki 3 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf 4 | -------------------------------------------------------------------------------- /default: -------------------------------------------------------------------------------- 1 | server { listen 80 default_server; listen [::]:80 default_server; 2 | 3 | root /var/www/html; index index.html index.htm index.nginx-debian.html index.php; 4 | 5 | server_name _; 6 | 7 | location / { try_files $uri $uri/ =404; 8 | } 9 | 10 | location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; 11 | } 12 | 13 | # deny access to .htaccess files, if Apache's document root concurs with nginx's one 14 | # 15 | #location ~ /\.ht { deny all; 16 | #} 17 | } 18 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ARCHS="linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6,linux/amd64,linux/386" 3 | cd /home/sql/myimages 4 | rm -rf /home/sql/myimages/webroot 5 | echo "###CLONING###" 6 | git clone https://github.com/sbrl/Pepperminty-Wiki.git webroot 7 | cd /home/sql/myimages/webroot 8 | LATEST="$(git describe --abbrev=0 --tags)" 9 | echo "###CHECKING OUT $LATEST###" 10 | git checkout $LATEST 11 | cd /home/sql/myimages 12 | echo "###BUILDING AND PUSHING $LATEST###" 13 | docker buildx build --platform $ARCHS -t sqlatenwiki/peppermintywiki:latest -t sqlatenwiki/peppermintywiki:stable -t sqlatenwiki/peppermintywiki:$LATEST . --push 14 | 15 | cd /home/sql/myimages 16 | rm -rf /home/sql/myimages/webroot 17 | echo "###CLONING###" 18 | git clone https://github.com/sbrl/Pepperminty-Wiki.git webroot 19 | cd /home/sql/myimages/webroot 20 | chown www-data:www-data * -R 21 | cd /home/sql/myimages 22 | docker buildx build --platform $ARCHS -t sqlatenwiki/peppermintywiki:dev -t sqlatenwiki/peppermintywiki:master . --push 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 SQL-enwiki 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 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | #Download base image debian stretch 2 | FROM debian:stretch 3 | 4 | # Update Software repository 5 | RUN apt-get update 6 | 7 | # Install nginx, php-fpm, and other prerequisites from ubuntu repository 8 | RUN apt-get install -y nginx php7.0-fpm php-mbstring php-imagick php-fileinfo php-zip php-intl supervisor ca-certificates && \ 9 | rm -rf /var/lib/apt/lists/* && \ 10 | rm -rf /var/www/html/* 11 | 12 | #Define the ENV variable 13 | ENV nginx_vhost /etc/nginx/sites-available/default 14 | ENV php_conf /etc/php/7.0/fpm/php.ini 15 | ENV nginx_conf /etc/nginx/nginx.conf 16 | ENV supervisor_conf /etc/supervisor/supervisord.conf 17 | 18 | # Enable php-fpm on nginx virtualhost configuration 19 | COPY default ${nginx_vhost} 20 | RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \ 21 | echo "\ndaemon off;" >> ${nginx_conf} 22 | 23 | COPY supervisord.conf ${supervisor_conf} 24 | 25 | RUN mkdir -p /run/php && \ 26 | chown -R www-data:www-data /var/www/html && \ 27 | chown -R www-data:www-data /run/php 28 | 29 | # Volume configuration 30 | VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx"] 31 | 32 | COPY start.sh /start.sh 33 | CMD ["./start.sh"] 34 | 35 | #COPY webroot/diff.min.js /var/www/html 36 | #COPY webroot/idindex.json /var/www/html 37 | #COPY webroot/index.php /var/www/html 38 | #COPY webroot/pageindex.json /var/www/html 39 | #COPY webroot/ParsedownExtra.php /var/www/html 40 | #COPY webroot/Parsedown.php /var/www/html 41 | #COPY webroot/peppermint.json /var/www/html 42 | #COPY webroot/recent-changes.json /var/www/html 43 | COPY webroot/* /var/www/html/ 44 | 45 | EXPOSE 80 46 | -------------------------------------------------------------------------------- /supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/dev/shm/supervisor.sock ; (the path to the socket file) 3 | 4 | [supervisord] 5 | logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log) 6 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 7 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 8 | loglevel=info ; (log level;default info; others: debug,warn,trace) 9 | pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 10 | nodaemon=false ; (start in foreground if true;default false) 11 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 12 | minprocs=200 ; (min. avail process descriptors;default 200) 13 | user=root ; 14 | 15 | ; the below section must remain in the config file for RPC 16 | ; (supervisorctl/web interface) to work, additional interfaces may be 17 | ; added by defining them in separate rpcinterface: sections 18 | [rpcinterface:supervisor] 19 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 20 | 21 | [supervisorctl] 22 | serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket 23 | 24 | ; The [include] section can just contain the "files" setting. This 25 | ; setting can list multiple files (separated by whitespace or 26 | ; newlines). It can also contain wildcards. The filenames are 27 | ; interpreted as relative to this file. Included files *cannot* 28 | ; include files themselves. 29 | 30 | [include] 31 | files = /etc/supervisor/conf.d/*.conf 32 | 33 | 34 | [program:php-fpm7.0] 35 | command=/usr/sbin/php-fpm7.0 -F 36 | numprocs=1 37 | autostart=true 38 | autorestart=true 39 | 40 | [program:nginx] 41 | command=/usr/sbin/nginx 42 | numprocs=1 43 | autostart=true 44 | autorestart=true --------------------------------------------------------------------------------