Skip to content

Commit 4572a91

Browse files
committed
added custom nginx.conf without daemon mode
1 parent d6e1ae7 commit 4572a91

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apt-get update -y && sudo apt-get upgrade -y && apt-get install -y php5 php5
1818
nodejs
1919

2020
# Install nginx
21-
RUN apt-get install -y nginx
21+
RUN apt-get install -y nginx-full
2222

2323
# Add build script
2424
RUN mkdir -p /root/setup
@@ -28,6 +28,7 @@ RUN (cd /root/setup/; /root/setup/setup.sh)
2828

2929
# Copy files from repo
3030
ADD build/default /etc/nginx/sites-available/default
31+
ADD build/nginx.conf /etc/nginx/nginx.conf
3132

3233
# Add all required files and folders, update permissions
3334
ADD build/nginx.sh /etc/service/nginx/run
@@ -36,9 +37,13 @@ RUN chmod +x /etc/service/nginx/run
3637
ADD build/phpfpm.sh /etc/service/phpfpm/run
3738
RUN chmod +x /etc/service/phpfpm/run
3839

40+
RUN mkdir -p /var/www/public
41+
ADD build/index.php /var/www/public/index.php
42+
3943
RUN chown -R www-data:www-data /var/www
4044
RUN chmod -R 755 /var/www
41-
RUN chown www-data:www-data -R /var/www/app/storage
45+
46+
#RUN chown www-data:www-data -R /var/www/app/storage
4247

4348
EXPOSE 80
4449
VOLUME /var/www

build/default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
server {
22
listen 80;
3+
#listen [::]:80 ipv6only=on default_server;
34

45
root /var/www/public/;
56
index index.html index.htm index.php;

build/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php phpinfo(); ?>

build/nginx.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
daemon off;
2+
3+
user www-data;
4+
worker_processes 1;
5+
6+
error_log /var/log/nginx/error.log;
7+
pid /var/run/nginx.pid;
8+
9+
events {
10+
worker_connections 1024;
11+
}
12+
13+
http {
14+
include /etc/nginx/mime.types;
15+
default_type application/octet-stream;
16+
17+
access_log /var/log/nginx/access.log;
18+
19+
sendfile on;
20+
#tcp_nopush on;
21+
22+
#keepalive_timeout 0;
23+
keepalive_timeout 65;
24+
tcp_nodelay on;
25+
26+
gzip on;
27+
28+
include /etc/nginx/conf.d/*.conf;
29+
include /etc/nginx/sites-enabled/*;
30+
}

0 commit comments

Comments
 (0)