File tree 4 files changed +48
-33
lines changed
4 files changed +48
-33
lines changed Original file line number Diff line number Diff line change 1
- FROM hasholding/alpine-base:3.8
1
+ FROM hasholding/nginx
2
2
LABEL maintainer
"Levent SAGIROGLU <[email protected] >"
3
- VOLUME /shared
4
- RUN apk add nginx php7-fpm
5
- RUN mkdir -p /run/nginx
6
- RUN sed -i 's/user = nobody/user = nginx/g' /etc/php7/php-fpm.d/www.conf
7
- RUN sed -i 's/group = nobody/group = nginx/g' /etc/php7/php-fpm.d/www.conf
8
3
9
- RUN echo "<?php phpinfo();" >/var/lib/nginx/html/info.php
10
- RUN chmod 755 /var/lib/nginx/html/info.php
4
+ EXPOSE 80 443
5
+ ENV PHP_CONF "/etc/php7/php-fpm.d/www.conf"
6
+ ENV WEB_CONF "/etc/nginx/conf.d/default.conf"
7
+ VOLUME /shared
11
8
12
- ENV PHP_CONF "/etc/php7/php-fpm.d"
13
- ENV CONF "/shared/local.conf"
9
+ RUN apk add --update --no-cache php7-fpm && \
10
+ sed -i 's/user = nobody/user = nginx/g' /etc/php7/php-fpm.d/www.conf && \
11
+ sed -i 's/group = nobody/group = nginx/g' /etc/php7/php-fpm.d/www.conf && \
12
+ echo "<?php phpinfo();" >/var/lib/nginx/html/info.php && \
13
+ chmod 755 /var/lib/nginx/html/info.php
14
14
15
- EXPOSE 80 443
16
15
COPY entrypoint.sh /bin/entrypoint.sh
17
- COPY local .conf /shared/local .conf
16
+ COPY default .conf /etc/nginx/conf.d/default .conf
18
17
ENTRYPOINT ["/bin/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ # This is a default site configuration which will simply return 404, preventing
2
+ # chance access to any other virtualhost.
3
+
4
+ server {
5
+ listen 80 default_server;
6
+ listen [::]:80 default_server;
7
+
8
+ location / {
9
+ root /var/lib/nginx/html/;
10
+ index index.php index.html index.htm;
11
+ }
12
+
13
+ location ~ \.php$ {
14
+
15
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
16
+ fastcgi_pass localhost:9000;
17
+ include /etc/nginx/fastcgi_params;
18
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19
+ }
20
+ }
21
+
22
+
23
+
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- cp -u /etc/php7/php-fpm.d/www.conf ${PHP_CONF}
3
- cp -u ${CONF} /etc/nginx/conf.d/
2
+
3
+ if [ -f " ${PHP_CONF} " ];
4
+ then
5
+ cp -f ${PHP_CONF} /etc/php7/php-fpm.d/www.conf
6
+ fi
7
+
8
+ if [ -f " ${WEB_CONF} " ];
9
+ then
10
+ cp -f ${WEB_CONF} /etc/nginx/conf.d/default.conf
11
+ fi
12
+
4
13
/usr/sbin/php-fpm7
5
14
/usr/sbin/nginx -g " daemon off;"
15
+
16
+
17
+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments