frontend: add nginx.conf to limit worker processes (#226)
set the number of nginx workers to 2 to avoid exceeding memory, which can happen with default worker_processes: auto due to the cpu limit setting.
This commit is contained in:
		
							parent
							
								
									ff42785410
								
							
						
					
					
						commit
						0fab6db75e
					
				| @ -1,4 +1,4 @@ | |||||||
| # central place to configure the production replayweb.pgae loading prefix | # central place to configure the production replayweb.page loading prefix | ||||||
| ARG RWP_BASE_URL=https://cdn.jsdelivr.net/npm/replaywebpage@1.5.8/ | ARG RWP_BASE_URL=https://cdn.jsdelivr.net/npm/replaywebpage@1.5.8/ | ||||||
| 
 | 
 | ||||||
| FROM node:16 as build | FROM node:16 as build | ||||||
| @ -32,7 +32,8 @@ ENV RWP_BASE_URL=${RWP_BASE_URL} | |||||||
| 
 | 
 | ||||||
| COPY --from=build /app/dist /usr/share/nginx/html | COPY --from=build /app/dist /usr/share/nginx/html | ||||||
| 
 | 
 | ||||||
| COPY ./nginx.conf.template /etc/nginx/templates/ | COPY ./nginx.conf /etc/nginx/nginx.conf | ||||||
|  | COPY ./frontend.template /etc/nginx/templates/ | ||||||
| 
 | 
 | ||||||
| RUN rm /etc/nginx/conf.d/* | RUN rm /etc/nginx/conf.d/* | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										31
									
								
								frontend/nginx.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								frontend/nginx.conf
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,31 @@ | |||||||
|  | user  nginx; | ||||||
|  | worker_processes  2; | ||||||
|  | 
 | ||||||
|  | error_log  /var/log/nginx/error.log notice; | ||||||
|  | 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; | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user