feat: better healthcheck and prevent useless composer install calls
This commit is contained in:
		
							parent
							
								
									253eae0e15
								
							
						
					
					
						commit
						b5710da39c
					
				@ -111,7 +111,7 @@ WORKDIR /srv/app
 | 
				
			|||||||
ADD --chmod=500 https://caddyserver.com/api/download?os=linux&arch=$TARGETARCH&p=github.com/dunglas/mercure/caddy&p=github.com/dunglas/vulcain/caddy /usr/bin/caddy
 | 
					ADD --chmod=500 https://caddyserver.com/api/download?os=linux&arch=$TARGETARCH&p=github.com/dunglas/mercure/caddy&p=github.com/dunglas/vulcain/caddy /usr/bin/caddy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
 | 
					COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
 | 
				
			||||||
HEALTHCHECK CMD wget --no-verbose --tries=1 --spider https://localhost/healthz || exit 1
 | 
					HEALTHCHECK CMD wget --no-verbose --tries=1 --spider http://localhost:2019/metrics || exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Prod Caddy image
 | 
					# Prod Caddy image
 | 
				
			||||||
FROM caddy_base AS caddy_prod
 | 
					FROM caddy_base AS caddy_prod
 | 
				
			||||||
 | 
				
			|||||||
@ -19,10 +19,6 @@ log {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
route {
 | 
					route {
 | 
				
			||||||
	# Healthcheck URL
 | 
					 | 
				
			||||||
	respond /healthz 200
 | 
					 | 
				
			||||||
	skip_log /healthz
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	root * /srv/app/public
 | 
						root * /srv/app/public
 | 
				
			||||||
	mercure {
 | 
						mercure {
 | 
				
			||||||
		# Transport to use (default to Bolt)
 | 
							# Transport to use (default to Bolt)
 | 
				
			||||||
 | 
				
			|||||||
@ -27,7 +27,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
 | 
				
			|||||||
		fi
 | 
							fi
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if [ "$APP_ENV" != 'prod' ]; then
 | 
						if [ ! -d 'vendor/' ]; then
 | 
				
			||||||
		composer install --prefer-dist --no-progress --no-interaction
 | 
							composer install --prefer-dist --no-progress --no-interaction
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user