From 391988d9e6ca3dd863d55a2d84189fda6aeb990c Mon Sep 17 00:00:00 2001 From: startxfr Date: Sat, 6 Dec 2014 00:29:03 +0100 Subject: changing php startup and adding php.ini and httpd config files --- Services/php/Dockerfile | 18 ++++++++---- Services/php/README.md | 4 ++- Services/php/app/index.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++ Services/php/httpd.conf | 8 ++++++ Services/php/index.php | 1 - Services/php/php.ini | 11 ++++++++ 6 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 Services/php/app/index.php create mode 100644 Services/php/httpd.conf delete mode 100644 Services/php/index.php create mode 100644 Services/php/php.ini (limited to 'Services/php') diff --git a/Services/php/Dockerfile b/Services/php/Dockerfile index ca945ee..2c86f15 100644 --- a/Services/php/Dockerfile +++ b/Services/php/Dockerfile @@ -1,15 +1,21 @@ FROM startx/sv-apache MAINTAINER Christophe LARUE -WORKDIR /src +USER root RUN yum -y install php php-pecl-mongo php-cli php-pear \ php-gd php-mcrypt php-mysqlnd php-soap php-pecl-xdebug \ php-pdo php-process php-common php-mbstring \ php-bcmath php-pecl-zip php-php-gettext php-tcpdf \ php-tcpdf-dejavu-sans-fonts php-tidy \ - && yum clean all \ - && rm -rf /var/www/html \ - && ln -s /src /var/www/html -COPY index.php /src/index.php + && yum clean all +# Copy application content +COPY app/* /var/www/html/ +COPY httpd.conf /etc/httpd/conf.d/sx.conf +COPY php.ini /etc/php.d/sx.ini +RUN chmod ug+r /var/www/html/* \ + && chown -R apache:apache /var/www/html /var/log/httpd -CMD ["/bin/apache_run.sh"] \ No newline at end of file +EXPOSE 80 +EXPOSE 443 +VOLUME ["/var/www/html", "/var/log/httpd"] +CMD ["/sx/httpd_run.sh"] \ No newline at end of file diff --git a/Services/php/README.md b/Services/php/README.md index 802f4d2..5a407a4 100644 --- a/Services/php/README.md +++ b/Services/php/README.md @@ -13,6 +13,8 @@ Copy sources in your docker host cd startx-docker-images; git clone https://github.com/startxfr/docker-images.git . +Change configuration and personalize your base image. you can change file httpd.conf if you want to add some config into http server. File php.ini will be added into php init scripts and executed when server start. + Build the container docker build -t sv-php Services/php/ @@ -28,7 +30,7 @@ access to the running webserver access to the container itself - docker exec -it php bash + docker exec -it php /bin/bash ## Related Resources * [Sources files](https://github.com/startxfr/docker-images/tree/master/Services/php) diff --git a/Services/php/app/index.php b/Services/php/app/index.php new file mode 100644 index 0000000..411b39b --- /dev/null +++ b/Services/php/app/index.php @@ -0,0 +1,70 @@ + + + + STARTX Webserver container + + + + +
+

STARTX PHP Webserver

+

Online

+
+ + + \ No newline at end of file diff --git a/Services/php/httpd.conf b/Services/php/httpd.conf new file mode 100644 index 0000000..2cb8301 --- /dev/null +++ b/Services/php/httpd.conf @@ -0,0 +1,8 @@ +# +# This file will be copied into /etc/httpd/conf.d/sx.conf and loaded when httpd start +# +ServerAdmin cl@startx.fr + + AllowOverride All + DirectoryIndex index.php index.html + diff --git a/Services/php/index.php b/Services/php/index.php deleted file mode 100644 index c9f5eeb..0000000 --- a/Services/php/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Services/php/php.ini b/Services/php/php.ini new file mode 100644 index 0000000..4207ce3 --- /dev/null +++ b/Services/php/php.ini @@ -0,0 +1,11 @@ +; This file will be copied into /etc/php.d/sx.ini and loaded when httpd start +display_errors = On +always_populate_raw_post_data = On + +max_execution_time = 60 + +memory_limit = 64M +post_max_size = 16M + +upload_max_filesize = 8M +upload_tmp_dir = /tmp/ \ No newline at end of file -- cgit v1.2.3