forked from outeredge/edge-docker-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
328a5e6
commit 035fdc7
Showing
10 changed files
with
172 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,19 @@ | ||
FROM ubuntu:14.10 | ||
FROM ubuntu:14.04 | ||
|
||
MAINTAINER outer/edge <hello@outeredgeuk.com> | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV HOME /root | ||
COPY build.sh /build.sh | ||
RUN /build.sh | ||
|
||
# Install Default Packages | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl nano wget software-properties-common \ | ||
ruby nodejs-legacy npm git-core apache2 libapache2-mod-php5 \ | ||
php5-cli php5-mysql php5-sqlite php5-curl php5-intl && \ | ||
apt-get clean && \ | ||
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY nginx-default /etc/nginx/conf.d/default | ||
COPY php-fpm.conf /usr/local/etc/php-fpm.conf | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
# Install composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
# Install bower | ||
RUN npm install -g bower && npm cache clean | ||
|
||
# Setup apache | ||
RUN a2enmod rewrite | ||
ADD apache.conf /etc/apache2/sites-enabled/000-default.conf | ||
ADD apache.sh /apache.sh | ||
RUN chmod +x /apache.sh | ||
|
||
# Cache | ||
VOLUME ["/root/.composer"] | ||
EXPOSE 80 | ||
|
||
WORKDIR /var/www | ||
|
||
EXPOSE 80 | ||
CMD ["/apache.sh"] | ||
CMD ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
edge-docker-php | ||
=============== | ||
# edge-docker-php | ||
Ubuntu 14.04 running Nginx 1.7 with Pagespeed and PHP 5.6 | ||
|
||
Base docker image for running PHP web applications. | ||
|
||
Included packages | ||
----------------- | ||
|
||
* Apache 2.4 | ||
* PHP (mysql, sqlite, curl, intl) | ||
* Ruby | ||
* Node.js | ||
* Git | ||
|
||
#### Package managers | ||
|
||
* Composer | ||
* Rubygems | ||
* Npm | ||
* Bower | ||
## Adding PHP extensions |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
NGINX_VERSION=1.7.10 | ||
NPS_VERSION=1.9.32.3 | ||
PHP_VERSION=5.6.7 | ||
|
||
DEBIAN_FRONTEND=noninteractive | ||
|
||
# build apt cache | ||
apt-get update | ||
|
||
# install basic tools | ||
apt-get install -y --no-install-recommends build-essential curl nano wget git-core ca-certificates supervisor | ||
|
||
# download ngx_pagespeed | ||
apt-get install -y --no-install-recommends zlib1g-dev libpcre3-dev libssl-dev | ||
mkdir /tmp/ngx_pagespeed | ||
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.tar.gz -O - | tar -zxf - --strip=1 -C /tmp/ngx_pagespeed | ||
wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz -O - | tar -zxf - -C /tmp/ngx_pagespeed | ||
|
||
# download and install nginx | ||
mkdir /tmp/nginx | ||
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -O - | tar -zxf - -C /tmp/nginx --strip=1 | ||
cd /tmp/nginx | ||
./configure \ | ||
--prefix=/etc/nginx/ \ | ||
--conf-path=/etc/nginx/nginx.conf \ | ||
--sbin-path=/usr/sbin/nginx \ | ||
--user=www-data \ | ||
--group=www-data \ | ||
--with-http_ssl_module \ | ||
--with-http_spdy_module \ | ||
--add-module=/tmp/ngx_pagespeed | ||
make -j"$(nproc)" | ||
make install | ||
mkdir -p /etc/nginx/conf.d | ||
mkdir -p -m 755 /var/cache/pagespeed | ||
chown -R www-data:www-data /var/cache/pagespeed | ||
|
||
# download and install php | ||
apt-get install -y --no-install-recommends libcurl4-openssl-dev libreadline6-dev libmcrypt-dev libxml2-dev libpng-dev libicu-dev | ||
mkdir /tmp/php | ||
wget http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror -O - | tar -jxf - -C /tmp/php --strip=1 | ||
cd /tmp/php | ||
./configure \ | ||
--with-config-file-path="/usr/local/etc/php" \ | ||
--with-libdir=/lib/x86_64-linux-gnu \ | ||
--with-fpm-user=www-data \ | ||
--with-fpm-group=www-data \ | ||
--disable-cgi \ | ||
--enable-fpm \ | ||
--enable-intl \ | ||
--enable-mbstring \ | ||
--enable-mysqlnd \ | ||
--enable-opcache \ | ||
--enable-zip \ | ||
--with-curl \ | ||
--with-openssl \ | ||
--with-readline \ | ||
--with-pdo-mysql \ | ||
--with-mcrypt \ | ||
--with-gd=shared | ||
make -j"$(nproc)" | ||
make install | ||
|
||
# cleanup | ||
apt-get purge -y build-essential g++ | ||
apt-get autoremove -y | ||
apt-get clean | ||
rm -rf /tmp/* /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
server { | ||
listen 80; | ||
root /var/www/public/; | ||
|
||
charset utf-8; | ||
|
||
#https://developers.google.com/speed/pagespeed/module/configuration | ||
#pagespeed on; | ||
|
||
location / { | ||
try_files $uri =404; | ||
|
||
fastcgi_index index.php; | ||
fastcgi_pass unix:/var/run/php-fpm.sock; | ||
include fastcgi.conf; | ||
} | ||
|
||
location = /favicon.ico { log_not_found off; access_log off; } | ||
location = /robots.txt { log_not_found off; access_log off; } | ||
|
||
# Deny .htaccess file access | ||
location ~ /\.ht { | ||
deny all; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
worker_processes auto; | ||
daemon off; | ||
error_log stderr warn; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server_tokens off; | ||
access_log off; | ||
|
||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
|
||
index index.php; | ||
|
||
pagespeed off; | ||
pagespeed FileCachePath /var/cache/pagespeed; # Use tmpfs for best results | ||
|
||
include /etc/nginx/conf.d/*; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[global] | ||
|
||
daemonize = no | ||
error_log = stderr | ||
|
||
[www] | ||
|
||
user = www-data | ||
group = www-data | ||
|
||
listen = 127.0.0.1:9000 | ||
|
||
pm = dynamic | ||
pm.max_children = 20 | ||
pm.min_spare_servers = 2 | ||
pm.max_spare_servers = 10 | ||
pm.max_requests = 5000 | ||
|
||
clear_env = no | ||
|
||
catch_workers_output = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:nginx] | ||
command=nginx | ||
redirect_stderr=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
|
||
[program:php-fpm] | ||
command=php-fpm | ||
redirect_stderr=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 |