diff options
Diffstat (limited to 'Services/php')
-rw-r--r-- | Services/php/Dockerfile | 18 | ||||
-rw-r--r-- | Services/php/README.md | 4 | ||||
-rw-r--r-- | Services/php/app/index.php | 70 | ||||
-rw-r--r-- | Services/php/httpd.conf | 8 | ||||
-rw-r--r-- | Services/php/index.php | 1 | ||||
-rw-r--r-- | Services/php/php.ini | 11 |
6 files changed, 104 insertions, 8 deletions
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 <dev@startx.fr> -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 @@ +<!DOCTYPE html> +<html> + <head> + <title>STARTX Webserver container</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <style> + body {font-family: Helvetica, Arial, sans-serif;font-size: 14px;color: #333;padding: 0;margin: 0;} + body > header { width: 900px; padding: 1em; margin: 0 auto 1em auto } + body > article {box-shadow: 5px 5px 10px rgba(0,0,0,0.8); padding: 0 0 .5em 0; border-radius: 5px; width: 900px; margin: 2em auto 0 auto } + body > footer { width: 900px; padding: 0em 0 1em 1em; margin: 1.1em auto 1em auto; color: white; font-size: .75em } + h1 { margin: 0; font-size: 3em; line-height: .8em } + h2 { text-shadow: 1px 1px 1px rgba(0,0,0,0.25); font-size: 2.2em;margin: .2em; } + h3 { text-shadow: 1px 1px 0px rgba(255,255,255,1); font-size: 1.5em;margin: .2em; } + h4 { font-size: 1.2em; margin: .2em; } + p { font-size: 1em; margin: .5em .2em; } + ul { + padding-bottom: 1em; + padding-left: 2em; + } + a { + color: white; + text-decoration: none; + background: transparent !important; + } + body > header h1 { color: #000e44; text-shadow: 0 0 3px rgb(255,255,255), 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.6); float: left } + body > header h1 span { color: #0c6f5e } + body > header h2 { color: white; font-size: .7em; font-weight: normal; margin: 2.2em 0 0 1em; float: left } + body > header h3 { color: #0c6f5e; margin: 0; font-size: 2em; float: right } + article header { margin: 0;padding: .3em; box-shadow: 0 0 5px rgba(0,0,0,0.9); border-radius: 5px 5px 0 0; width: 892px; } + article h3 { display: inline; } + article > details { margin: 1em; } + + + body#error { background-color : #533;} + #error article { color : darkred; background-color : rgba(255,255,255,0.9); clear: both } + #error article h2 { color : white; text-shadow: 0 0 2px white, 0 0 15px #600, 3px 3px 8px rgba(50,0,0,0.9); } + #error article header { background-color : rgba(85,51,51,0.6); } + #error h3, #error article a { color : #744; } + #error article a:hover { color : #533; } + #error pre.xdebug-var-dump {font-size:0.8em} + + body#answer { background-color : #353 } + #answer article { color : #575;background-color : rgba(255,255,255,0.9); clear: both } + #answer article h2 { color : white; text-shadow: 0 0 2px rgba(11,45,11,0.9), 0 0 10px rgba(11,45,11,0.8); } + #answer article header { background-color : rgba(51,85,51,0.6); } + #answer h3, #answer article a { color : #686; } + #answer article a:hover { color : #353; } + </style> + </head> + <body id="answer"> + <header> + <h1><span>STARTX</span> PHP Webserver</h1> + <h3>Online</h3> + </header> + <article> + <header> + <h2>Congratulation !!!</h2> + </header> + <p> + You are actually running an apache webserver + php running under the latest fedora release. For more information about this container and how to add your content instead of this message, please read the following links. + <ul> + <li><a href="https://github.com/startxfr/docker-images/tree/master/Services/php" target="_blank">See this container Dockerfile</a></li> + <li><a href="https://github.com/startxfr/docker-images" target="_blank">STARTX github docker images repository</a></li> + <li><a href="https://registry.hub.docker.com/u/startx/" target="_blank">STARTX Dockerhub profile</a></li> + </ul> + <?php phpinfo(); ?> + </p> + </article> + <footer><p>© 2015 - <a href="https://github.com/startxfr" target="_blank">STARTX</a> - <a href="https://www.startx.fr" target="_blank">STARTX Dev Team</a></p></footer> +</body></html>
\ 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 +<Directory "/var/www/html"> + AllowOverride All + DirectoryIndex index.php index.html +</Directory> 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 @@ -<?php phpinfo(); ?>
\ 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 |