Skip to content

Commit

Permalink
include bludit package in Dockerfile and added PHP 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dignajar committed Apr 6, 2019
1 parent e43aa3c commit 6b352ae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
38 changes: 21 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
FROM centos:centos7

ENV nginx_conf /etc/nginx/nginx.conf
ENV php_conf /etc/php.ini
ENV fpm_conf /etc/php-fpm.conf
ENV fpm_pool /etc/php-fpm.d/www.conf
ENV bludit_content /usr/share/nginx/html/bl-content
ENV bludit_url https://www.bludit.com/releases/bludit-3-8-1.zip

RUN yum -y update
RUN yum install -y epel-release
RUN yum install -y nginx php-fpm php-gd php-json php-dom php-xml php-zip php-mbstring
RUN yum install -y supervisor unzip jq
ENV nginx_path /etc/nginx
ENV nginx_conf ${nginx_path}/nginx.conf
ENV php_conf /etc/opt/rh/rh-php72/php.ini
ENV fpm_conf /etc/opt/rh/rh-php72/php-fpm.conf
ENV fpm_pool /etc/opt/rh/rh-php72/php-fpm.d/www.conf

# Configs files
RUN yum install -y epel-release centos-release-scl.noarch && \
yum -y update && \
yum install -y nginx rh-php72-php-fpm rh-php72-php-gd rh-php72-php-json rh-php72-php-dom rh-php72-php-xml rh-php72-php-zip rh-php72-php-mbstring supervisor unzip jq

# Config files
RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" ${php_conf} && \
sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" ${php_conf} && \
sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" ${php_conf} && \
Expand All @@ -26,20 +29,20 @@ RUN sed -i -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm.sock/g" ${

RUN echo "daemon off;" >> ${nginx_conf}

RUN mkdir -p /var/lib/php/session && \
chown -R nginx:nginx /var/lib/php/session
RUN chown -R nginx:nginx /var/opt/rh/rh-php72/lib/php

# Cleaning
RUN rm -rf /etc/nginx/conf.d/* && \
# Clean up
RUN yum clean all && \
rm -rf ${nginx_path}/conf.d/* && \
rm -rf /var/cache/*

# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

# Configurations files
ADD conf/default.conf /etc/nginx/conf.d/default.conf
ADD conf/nginx.conf /etc/nginx/nginx.conf
ADD conf/default.conf ${nginx_path}/conf.d/default.conf
ADD conf/nginx.conf ${nginx_conf}
ADD conf/supervisord.conf /etc/supervisord.conf

# Nginx logs to Docker log collector
Expand All @@ -48,12 +51,13 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && \

# Bludit installation
RUN cd /tmp/ && \
curl -o /tmp/bludit.zip `curl --silent https://version.bludit.com | jq -r .stable.downloadLink` && \
curl -o /tmp/bludit.zip ${bludit_url} && \
unzip /tmp/bludit.zip && \
rm -rf /usr/share/nginx/html && \
mv bludit-* /usr/share/nginx/html && \
chown -R nginx:nginx /usr/share/nginx/html && \
chmod 755 /usr/share/nginx/html/bl-content && \
chmod 755 ${bludit_content} && \
sed -i "s/'DEBUG_MODE', FALSE/'DEBUG_MODE', TRUE/g" /usr/share/nginx/html/bl-kernel/boot/init.php && \
rm -f /tmp/bludit.zip

EXPOSE 80
Expand Down
2 changes: 1 addition & 1 deletion conf/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nodaemon=true

[program:php-fpm]
command = /usr/sbin/php-fpm -c /etc/php
command = /opt/rh/rh-php72/root/usr/sbin/php-fpm -F
autostart=true
autorestart=true
priority=5
Expand Down

0 comments on commit 6b352ae

Please sign in to comment.