Major updates.
- upgrade docker compose to v2 - build images locally instead of pulling them from the registry - separate php container form nginx container - support all the php versions including php 7.0 - remove beanstalked container to be optionally added later by the user
This commit is contained in:
		
							
								
								
									
										14
									
								
								nginx/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								nginx/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
FROM nginx:latest
 | 
			
		||||
 | 
			
		||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
 | 
			
		||||
 | 
			
		||||
ADD nginx.conf /etc/nginx/
 | 
			
		||||
ADD laravel.conf /etc/nginx/sites-available/
 | 
			
		||||
 | 
			
		||||
RUN echo "upstream php-upstream { server php:9000; }" > /etc/nginx/conf.d/upstream.conf
 | 
			
		||||
 | 
			
		||||
RUN usermod -u 1000 www-data
 | 
			
		||||
 | 
			
		||||
CMD ["nginx"]
 | 
			
		||||
 | 
			
		||||
EXPOSE 80 443
 | 
			
		||||
							
								
								
									
										26
									
								
								nginx/laravel.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								nginx/laravel.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
server {
 | 
			
		||||
    listen 80 default_server;
 | 
			
		||||
    listen [::]:80 default_server ipv6only=on;
 | 
			
		||||
 | 
			
		||||
    root /var/www/laravel/public;
 | 
			
		||||
    index index.php index.html index.htm;
 | 
			
		||||
 | 
			
		||||
    location / {
 | 
			
		||||
         try_files $uri $uri/ /index.php$is_args$args;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    location ~ \.php$ {
 | 
			
		||||
        try_files $uri /index.php =404;
 | 
			
		||||
        fastcgi_pass php-upstream;
 | 
			
		||||
        fastcgi_index index.php;
 | 
			
		||||
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 | 
			
		||||
        include fastcgi_params;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    location ~ /\.ht {
 | 
			
		||||
        deny all;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										29
									
								
								nginx/nginx.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								nginx/nginx.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
user www-data;
 | 
			
		||||
worker_processes 4;
 | 
			
		||||
pid /run/nginx.pid;
 | 
			
		||||
 | 
			
		||||
events {
 | 
			
		||||
  worker_connections  2048;
 | 
			
		||||
  multi_accept on;
 | 
			
		||||
  use epoll;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
http {
 | 
			
		||||
  server_tokens off;
 | 
			
		||||
  sendfile on;
 | 
			
		||||
  tcp_nopush on;
 | 
			
		||||
  tcp_nodelay on;
 | 
			
		||||
  keepalive_timeout 15;
 | 
			
		||||
  types_hash_max_size 2048;
 | 
			
		||||
  include /etc/nginx/mime.types;
 | 
			
		||||
  default_type application/octet-stream;
 | 
			
		||||
  access_log off;
 | 
			
		||||
  error_log off;
 | 
			
		||||
  gzip on;
 | 
			
		||||
  gzip_disable "msie6";
 | 
			
		||||
  include /etc/nginx/conf.d/*.conf;
 | 
			
		||||
  include /etc/nginx/sites-available/*;
 | 
			
		||||
  open_file_cache max=100;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
daemon off;
 | 
			
		||||
		Reference in New Issue
	
	Block a user