Skip to content

Commit f3e45ad

Browse files
author
Levent.Sagiroglu
committed
yeni
1 parent b6ef21d commit f3e45ad

File tree

4 files changed

+36
-16
lines changed

4 files changed

+36
-16
lines changed

Dockerfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ FROM hasholding/alpine-base:3.8
22
LABEL maintainer "Levent SAGIROGLU <[email protected]>"
33
VOLUME /shared
44
RUN apk add nginx php7-fpm
5-
RUN mkdir -p /run/nginx
5+
RUN mkdir -p /run/nginx
66
RUN sed -i 's/user = nobody/user = nginx/g' /etc/php7/php-fpm.d/www.conf
77
RUN sed -i 's/group = nobody/group = nginx/g' /etc/php7/php-fpm.d/www.conf
88

9+
RUN echo "<?php phpinfo();" >/var/lib/nginx/html/info.php
10+
RUN chmod 755 /var/lib/nginx/html/info.php
11+
912
ENV PHP_CONF "/etc/php7/php-fpm.d"
10-
ENV NGINX_CONF "/etc/nginx/conf.d"
13+
ENV CONF "/shared/local.conf"
1114

1215
EXPOSE 80 443
13-
RUN echo "<?php phpinfo();" >/var/lib/nginx/html/info.php
14-
RUN chmod 755 /var/lib/nginx/html/info.php
1516
COPY entrypoint.sh /bin/entrypoint.sh
16-
COPY default.conf /etc/nginx/conf.d/
17-
ENTRYPOINT ["/bin/entrypoint.sh"]
17+
COPY local.conf /shared/local.conf
18+
ENTRYPOINT ["/bin/entrypoint.sh"]

default.conf

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
server {
2-
listen 80 default_server;
2+
listen 80 default_server;
33
server_name _;
4-
root /var/lib/nginx/html/;
4+
5+
6+
location / {
7+
root /var/lib/nginx/html/;
8+
index index.html index.htm index.php;
9+
}
510

611
location ~ \.php$ {
712

@@ -10,10 +15,5 @@ server {
1015
include /etc/nginx/fastcgi_params;
1116
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
1217
}
13-
14-
error_page 500 502 503 504 /50x.html;
15-
location = /50x.html {
16-
root /var/lib/nginx/html/;
17-
}
18-
19-
}
18+
19+
}

entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22
cp -u /etc/php7/php-fpm.d/www.conf ${PHP_CONF}
3-
cp -u /etc/nginx/conf.d/default.conf ${NGINX_CONF}
3+
cp -u ${CONF} /etc/nginx/conf.d/
44
/usr/sbin/php-fpm7
55
/usr/sbin/nginx -g "daemon off;"

local.conf

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /var/lib/nginx/html/;
5+
6+
location ~ \.php$ {
7+
8+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
9+
fastcgi_pass localhost:9000;
10+
include /etc/nginx/fastcgi_params;
11+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
12+
}
13+
14+
error_page 500 502 503 504 /50x.html;
15+
location = /50x.html {
16+
root /var/lib/nginx/html/;
17+
}
18+
19+
}

0 commit comments

Comments
 (0)