Skip to content
Snippets Groups Projects
Commit b298c131 authored by Igor Witz's avatar Igor Witz Committed by Barbare Antoine
Browse files

Correction de bugs, suppression du entrypoint superflu

parent 06b688c5
No related branches found
No related tags found
1 merge request!18Correction vulnérabilités Dokuwiki
FROM nginx
LABEL maintainer="antoine@barbare.me"
COPY --chown=www-data nginx.conf /etc/nginx/nginx.conf
COPY --chown=www-data run.sh /
WORKDIR /var/www
RUN apt-get update -y \
RUN apt-get update -y && \
apt-get install -y \
curl \
tar \
php7.0 \
php7.0-fpm \
php7.0-gd \
php7.0-xml; \
mkdir -p html; \
chown -R nginx:nginx /var/www/html
USER nginx
COPY nginx.conf /etc/nginx/nginx.conf
RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php/7.0/fpm/php.ini; \
sed -i -e "s|;daemonize\s*=\s*yes|daemonize = no|g" /etc/php/7.0/fpm/php-fpm.conf; \
sed -i -e "s|listen\s*=\s*127\.0\.0\.1:9000|listen = /var/run/php-fpm7.sock|g" /etc/php/7.0/fpm/pool.d/www.conf; \
sed -i -e "s|;listen\.owner\s*=\s*|listen.owner = |g" /etc/php/7.0/fpm/pool.d/www.conf; \
sed -i -e "s|;listen\.group\s*=\s*|listen.group = |g" /etc/php/7.0/fpm/pool.d/www.conf; \
sed -i -e "s|;listen\.mode\s*=\s*|listen.mode = |g" /etc/php/7.0/fpm/pool.d/www.conf; \
curl -O -L "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz" && \
wget \
tar \
php7.0 \
php7.0-fpm \
php7.0-gd \
php7.0-xml && \
mkdir -p html /var/run/php && \
echo "cgi.fix_pathinfo = 0;" >> /etc/php/7.0/fpm/php.ini && \
sed -i -e "s|;daemonize\s*=\s*yes|daemonize = no|g" /etc/php/7.0/fpm/php-fpm.conf && \
sed -i -e "s|listen\s*=\s*127\.0\.0\.1:9000|listen = /var/run/php-fpm7.sock|g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s|;listen\.owner\s*=\s*|listen.owner = |g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s|;listen\.group\s*=\s*|listen.group = |g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s|;listen\.mode\s*=\s*|listen.mode = |g" /etc/php/7.0/fpm/pool.d/www.conf && \
wget "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz" && \
tar -xzf dokuwiki-stable.tgz -C html --strip-components 1 && \
rm -Rf dokuwiki*
rm -f dokuwiki-stable.tgz && \
chown -R www-data . && \
chmod +x /run.sh && \
sed -i "s/\${MAXSIZE}/100M/g" /etc/nginx/nginx.conf
USER root
RUN apt-get remove -y tar && \
apt-get -y autoclean && \
apt-get -y clean && \
apt-get -y autoremove
USER nginx
EXPOSE 80
VOLUME ["/var/www/html"]
HEALTHCHECK CMD curl -s 127.0.0.1:${DOKUWIKI_PORT:=80}
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
COPY run.sh /run.sh
CMD ["run.sh"]
HEALTHCHECK CMD wget -q -O /dev/null http://127.0.0.1:${DOKUWIKI_PORT:=80}/
CMD ["/run.sh"]
wiki:
container_name: wiki
image: registry.picasoft.net:5000/pica-dokuwiki:2018.05
volumes:
- /DATA/docker/wiki/html:/var/www/html
environment:
- MAX_UPLOAD_SIZE=100M
security_opt:
- no-new-privileges
mem_limit: 2048m
cpus: "0.20"
pids_limit: 1024
labels:
- "traefik.frontend.rule=Host:wiki.picasoft.net"
- "traefik.port=80"
- "traefik.enable=true"
restart: always
version : "2.4"
services:
wiki:
container_name: wiki
image: pica-dokuwiki:2018.05
volumes:
- /DATA/docker/wiki/html:/var/www/html
security_opt:
- no-new-privileges
mem_limit: 2048m
cpus: "0.20"
pids_limit: 1024
labels:
- "traefik.frontend.rule=Host:wiki.test.picasoft.net"
- "traefik.port=80"
- "traefik.enable=true"
restart: always
#!/bin/bash
MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE:-10M}
sed -i "s/\${MAXSIZE}/$MAX_UPLOAD_SIZE/g" /etc/nginx/nginx.conf
......@@ -3,7 +3,7 @@ daemon off;
user www-data;
worker_processes 1;
error_log stderr error;
error_log stderr error;
events {
worker_connections 1024;
......@@ -14,13 +14,9 @@ http {
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
......@@ -35,14 +31,7 @@ http {
try_files $uri $uri/ @dokuwiki;
}
#location @dokuwiki {
# rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
# rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
# rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
# rewrite ^/(.*) /doku.php?id=$1 last;
#}
location ~ \.php$ {
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
......
......@@ -6,8 +6,8 @@
set -m
php7.0-fpm &
nginx -g "daemon off;" &
php-fpm7.0 &
nginx &
pids=`jobs -p`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment