Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
10
research/chatwoot/docker/entrypoints/helpers/pg_database_url.rb
Executable file
10
research/chatwoot/docker/entrypoints/helpers/pg_database_url.rb
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'uri'
|
||||
|
||||
# Let DATABASE_URL env take presedence over individual connection params.
|
||||
if !ENV['DATABASE_URL'].nil? && ENV['DATABASE_URL'] != ''
|
||||
uri = URI(ENV.fetch('DATABASE_URL', nil))
|
||||
puts "export POSTGRES_HOST=#{uri.host} POSTGRES_PORT=#{uri.port} POSTGRES_USERNAME=#{uri.user}"
|
||||
elsif ENV['POSTGRES_PORT'].nil? || ENV['POSTGRES_PORT'] == ''
|
||||
puts 'export POSTGRES_PORT=5432'
|
||||
end
|
||||
34
research/chatwoot/docker/entrypoints/rails.sh
Executable file
34
research/chatwoot/docker/entrypoints/rails.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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 "$@"
|
||||
12
research/chatwoot/docker/entrypoints/vite.sh
Executable file
12
research/chatwoot/docker/entrypoints/vite.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
rm -rf /app/tmp/pids/server.pid
|
||||
rm -rf /app/tmp/cache/*
|
||||
|
||||
pnpm store prune
|
||||
pnpm install --force
|
||||
|
||||
echo "Ready to run Vite development server."
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user