mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 13:07:55 +00:00 
			
		
		
		
	* natively compile ruby gems * add missing compiler tools * add bundler platform ruby to force native compilation * fix bundler env in final docker stage * add comments to DockerFile Co-authored-by: Sojan Jose <sojan@pepalo.com>
		
			
				
	
	
		
			35 lines
		
	
	
		
			745 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			745 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
set -x
 | 
						|
 | 
						|
# Remove a potentially pre-existing server.pid for Rails.
 | 
						|
rm -rf /app/tmp/pids/server.pid
 | 
						|
rm -rf /app/tmp/cache/*
 | 
						|
 | 
						|
echo "Waiting for postgres to become ready...."
 | 
						|
 | 
						|
# Let DATABASE_URL env take presedence over individual connection params.
 | 
						|
# This is done to avoid printing the DATABASE_URL in the logs
 | 
						|
$(docker/entrypoints/helpers/pg_database_url.rb)
 | 
						|
PG_READY="pg_isready -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USERNAME"
 | 
						|
 | 
						|
until $PG_READY
 | 
						|
do
 | 
						|
  sleep 2;
 | 
						|
done
 | 
						|
 | 
						|
echo "Database ready to accept connections."
 | 
						|
 | 
						|
#install missing gems for local dev as we are using base image compiled for production
 | 
						|
bundle install
 | 
						|
 | 
						|
BUNDLE="bundle check"
 | 
						|
 | 
						|
until $BUNDLE
 | 
						|
do
 | 
						|
  sleep 2;
 | 
						|
done
 | 
						|
 | 
						|
# Execute the main process of the container
 | 
						|
exec "$@"
 |