You've already forked dockerfiles
							
							
				mirror of
				https://github.com/vimagick/dockerfiles.git
				synced 2025-10-30 23:47:48 +02:00 
			
		
		
		
	update nginx
This commit is contained in:
		| @@ -1,15 +0,0 @@ | ||||
| # | ||||
| # Dockerfile for nginx | ||||
| # | ||||
|  | ||||
| FROM alpine | ||||
|  | ||||
| MAINTAINER kev <noreply@easypi.pro> | ||||
|  | ||||
| RUN set -xe \ | ||||
|     && apk add --no-cache nginx \ | ||||
|     && mkdir -p /run/nginx | ||||
|  | ||||
| EXPOSE 80 | ||||
|  | ||||
| CMD ["nginx", "-g", "daemon off;"] | ||||
| @@ -17,9 +17,9 @@ nginx: | ||||
|   ports: | ||||
|     - "80:80" | ||||
|   volumes: | ||||
|     - ./data/default.conf:/etc/nginx/default.conf | ||||
|     - ./data/conf.d:/etc/nginx/conf.d | ||||
|     - ./data/html:/usr/share/nginx/html | ||||
|   restart: always | ||||
|   restart: unless-stopped | ||||
| ``` | ||||
|  | ||||
| ## Reverse Proxy | ||||
| @@ -30,53 +30,16 @@ File: docker-compose.yml | ||||
| nginx: | ||||
|   image: nginx:alpine | ||||
|   volumes: | ||||
|     - ./data/default.conf:/etc/nginx/conf.d/default.conf | ||||
|     - ./data/conf.d:/etc/nginx/conf.d | ||||
|     - ./data/ssl:/etc/nginx/ssl | ||||
|     - ./data/htpasswd:/etc/nginx/htpasswd | ||||
|   net: host | ||||
|   restart: always | ||||
|   restart: unless-stopped | ||||
| ``` | ||||
|  | ||||
| > Password file can be generated by: | ||||
| >> `echo "username:$(openssl passwd -apr1 password)" >> data/htpasswd` | ||||
|  | ||||
| File: nginx.conf | ||||
|  | ||||
| ```nginx | ||||
| user  nginx; | ||||
| worker_processes  4; | ||||
|  | ||||
| error_log  /var/log/nginx/error.log warn; | ||||
| pid        /var/run/nginx.pid; | ||||
|  | ||||
|  | ||||
| events { | ||||
|     worker_connections  1024; | ||||
| } | ||||
|  | ||||
|  | ||||
| http { | ||||
|     include       /etc/nginx/mime.types; | ||||
|     default_type  application/octet-stream; | ||||
|  | ||||
|     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' | ||||
|                       '$status $body_bytes_sent "$http_referer" ' | ||||
|                       '"$http_user_agent" "$http_x_forwarded_for"'; | ||||
|  | ||||
|     access_log  /var/log/nginx/access.log  main; | ||||
|  | ||||
|     sendfile        on; | ||||
|     #tcp_nopush     on; | ||||
|  | ||||
|     keepalive_timeout  65; | ||||
|  | ||||
|     #gzip  on; | ||||
|  | ||||
|     include /etc/nginx/conf.d/*.conf; | ||||
|     include /etc/nginx/sites-enabled/*; | ||||
| } | ||||
| ``` | ||||
|  | ||||
| File: default | ||||
|  | ||||
| ```nginx | ||||
|   | ||||
| @@ -1,15 +0,0 @@ | ||||
| # | ||||
| # Dockerfile for nginx-arm | ||||
| # | ||||
|  | ||||
| FROM easypi/alpine-arm | ||||
|  | ||||
| MAINTAINER EasyPi Software Foundation | ||||
|  | ||||
| RUN set -xe \ | ||||
|     && apk add --no-cache nginx \ | ||||
|     && mkdir -p /run/nginx | ||||
|  | ||||
| EXPOSE 80 | ||||
|  | ||||
| CMD ["nginx", "-g", "daemon off;"] | ||||
| @@ -1,7 +1,7 @@ | ||||
| nginx: | ||||
|   image: easypi/nginx-arm | ||||
|   image: arm32v7/nginx:alpine | ||||
|   volumes: | ||||
|     - ./data/default.conf:/etc/nginx/conf.d/default.conf | ||||
|     - ./data/conf.d:/etc/nginx/conf.d | ||||
|     - ./data/ssl:/etc/nginx/ssl | ||||
|   net: host | ||||
|   restart: always | ||||
|   restart: unless-stopped | ||||
|   | ||||
							
								
								
									
										0
									
								
								nginx/data/ssl/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								nginx/data/ssl/.gitkeep
									
									
									
									
									
										Normal file
									
								
							| @@ -1,7 +1,7 @@ | ||||
| nginx: | ||||
|   image: nginx:alpine | ||||
|   volumes: | ||||
|     - ./data/default.conf:/etc/nginx/conf.d/default.conf | ||||
|     - ./data/conf.d:/etc/nginx/conf.d | ||||
|     - ./data/ssl:/etc/nginx/ssl | ||||
|   net: host | ||||
|   restart: always | ||||
|   restart: unless-stopped | ||||
|   | ||||
		Reference in New Issue
	
	Block a user