Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9c09f4

Browse files
committed
initial commit - credit to ngineered/nginx-php-fpm
0 parents commit e9c09f4

File tree

13 files changed

+1284
-0
lines changed

13 files changed

+1284
-0
lines changed

‎Dockerfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
FROM alpine:3.4
2+
3+
MAINTAINER ngineered <support@ngineered.co.uk>
4+
5+
ENV php_conf /etc/php5/php.ini
6+
ENV fpm_conf /etc/php5/php-fpm.conf
7+
ENV composer_hash e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae
8+
9+
RUN apk add --no-cache bash \
10+
openssh-client \
11+
wget \
12+
nginx \
13+
supervisor \
14+
curl \
15+
git \
16+
php5-fpm \
17+
php5-pdo \
18+
php5-pdo_mysql \
19+
php5-mysql \
20+
php5-mysqli \
21+
php5-mcrypt \
22+
php5-ctype \
23+
php5-zlib \
24+
php5-gd \
25+
php5-intl \
26+
php5-memcache \
27+
php5-sqlite3 \
28+
php5-pgsql \
29+
php5-xml \
30+
php5-xsl \
31+
php5-curl \
32+
php5-openssl \
33+
php5-iconv \
34+
php5-json \
35+
php5-phar \
36+
php5-soap \
37+
php5-dom \
38+
python \
39+
python-dev \
40+
py-pip \
41+
augeas-dev \
42+
openssl-dev \
43+
ca-certificates \
44+
dialog \
45+
gcc \
46+
musl-dev \
47+
linux-headers \
48+
libffi-dev &&\
49+
mkdir -p /etc/nginx && \
50+
mkdir -p /var/www/app && \
51+
mkdir -p /run/nginx && \
52+
mkdir -p /var/log/supervisor &&\
53+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
54+
php -r "if (hash_file('SHA384', 'composer-setup.php') === '${composer_hash}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
55+
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
56+
php -r "unlink('composer-setup.php');" && \
57+
pip install -U certbot && \
58+
mkdir -p /etc/letsencrypt/webrootauth && \
59+
apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev
60+
61+
62+
ADD conf/supervisord.conf /etc/supervisord.conf
63+
64+
# Copy our nginx config
65+
RUN rm -Rf /etc/nginx/nginx.conf
66+
ADD conf/nginx.conf /etc/nginx/nginx.conf
67+
68+
# nginx site conf
69+
RUN mkdir -p /etc/nginx/sites-available/ && \
70+
mkdir -p /etc/nginx/sites-enabled/ && \
71+
mkdir -p /etc/nginx/ssl/ && \
72+
rm -Rf /var/www/* && \
73+
mkdir /var/www/html/
74+
ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
75+
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
76+
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
77+
78+
# tweak php-fpm config
79+
RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" ${php_conf} && \
80+
sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" ${php_conf} && \
81+
sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" ${php_conf} && \
82+
sed -i -e "s/variables_order = \"GPCS\"/variables_order = \"EGPCS\"/g" ${php_conf} && \
83+
sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" ${fpm_conf} && \
84+
sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" ${fpm_conf} && \
85+
sed -i -e "s/pm.max_children = 4/pm.max_children = 4/g" ${fpm_conf} && \
86+
sed -i -e "s/pm.start_servers = 2/pm.start_servers = 3/g" ${fpm_conf} && \
87+
sed -i -e "s/pm.min_spare_servers = 1/pm.min_spare_servers = 2/g" ${fpm_conf} && \
88+
sed -i -e "s/pm.max_spare_servers = 3/pm.max_spare_servers = 4/g" ${fpm_conf} && \
89+
sed -i -e "s/pm.max_requests = 500/pm.max_requests = 200/g" ${fpm_conf} && \
90+
sed -i -e "s/user = nobody/user = nginx/g" ${fpm_conf} && \
91+
sed -i -e "s/group = nobody/group = nginx/g" ${fpm_conf} && \
92+
sed -i -e "s/;listen.mode = 0660/listen.mode = 0666/g" ${fpm_conf} && \
93+
sed -i -e "s/;listen.owner = nobody/listen.owner = nginx/g" ${fpm_conf} && \
94+
sed -i -e "s/;listen.group = nobody/listen.group = nginx/g" ${fpm_conf} && \
95+
sed -i -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm.sock/g" ${fpm_conf} &&\
96+
sed -i -e "s/^;clear_env = no$/clear_env = no/" ${fpm_conf} &&\
97+
ln -s /etc/php5/php.ini /etc/php5/conf.d/php.ini && \
98+
find /etc/php5/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/1円;2円/g' {} \;
99+
100+
# Add Scripts
101+
ADD scripts/start.sh /start.sh
102+
ADD scripts/pull /usr/bin/pull
103+
ADD scripts/push /usr/bin/push
104+
ADD scripts/letsencrypt-setup /usr/bin/letsencrypt-setup
105+
ADD scripts/letsencrypt-renew /usr/bin/letsencrypt-renew
106+
RUN chmod 755 /usr/bin/pull && chmod 755 /usr/bin/push && chmod 755 /usr/bin/letsencrypt-setup && chmod 755 /usr/bin/letsencrypt-renew && chmod 755 /start.sh
107+
108+
# copy in code
109+
ADD src/ /var/www/html/
110+
111+
EXPOSE 443 80
112+
113+
#CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
114+
CMD ["/start.sh"]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /