Skip to content

Commit 6e07061

Browse files
authored
Merge pull request laradock#184 from computerfr33k/nginx-alpine
Nginx alpine image
2 parents c60cb9a + e4f6cec commit 6e07061

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

nginx/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
FROM nginx:latest
1+
FROM nginx:alpine
22

33
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
44

55
ADD nginx.conf /etc/nginx/
6-
ADD laravel.conf /etc/nginx/sites-available/
6+
ADD laravel.conf /etc/nginx/conf.d/laravel.conf
77

8-
ARG PHP_UPSTREAM
8+
ARG PHP_UPSTREAM=php-fpm
99

10-
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf
11-
12-
RUN usermod -u 1000 www-data
10+
RUN apk update \
11+
&& apk upgrade \
12+
&& apk add --no-cache bash \
13+
&& adduser -D -H -u 1000 -s /bin/bash www-data \
14+
&& rm /etc/nginx/conf.d/default.conf \
15+
&& echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf
1316

1417
CMD ["nginx"]
1518

nginx/nginx.conf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
user www-data;
22
worker_processes 4;
33
pid /run/nginx.pid;
4+
daemon off;
45

56
events {
67
worker_connections 2048;
@@ -18,13 +19,10 @@ http {
1819
client_max_body_size 20M;
1920
include /etc/nginx/mime.types;
2021
default_type application/octet-stream;
21-
access_log on;
22-
error_log on;
22+
access_log /var/log/nginx/access.log;
23+
error_log /var/log/nginx/error.log;
2324
gzip on;
2425
gzip_disable "msie6";
2526
include /etc/nginx/conf.d/*.conf;
26-
include /etc/nginx/sites-available/*;
2727
open_file_cache max=100;
2828
}
29-
30-
daemon off;

0 commit comments

Comments
 (0)