Enhance Docker and PowerShell scripts for improved functionality and maintainability
All checks were successful
Publish FaceAI Container / publish (push) Successful in 6m52s
All checks were successful
Publish FaceAI Container / publish (push) Successful in 6m52s
- Updated Dockerfile to include default MySQL client for better database interaction. - Modified entrypoint.sh to support additional workspace for legacy applications and added MySQL readiness check before startup. - Enhanced PowerShell script for trimming MySQL dumps to include overlay dumps and improved error handling for missing race and user IDs. - Added new image files and face encoding pickles for various projects, ensuring comprehensive data availability. - Removed outdated face encoding pickle from PISA directory to maintain data relevance. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
c227fce036
commit
dd7d4c865b
54 changed files with 492 additions and 144 deletions
|
|
@ -1,7 +1,7 @@
|
|||
FROM tomcat:9.0.102-jdk11-temurin
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates bash perl rsync \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates bash default-mysql-client perl rsync \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY tomcat/bootstrap-docbase.sh /usr/local/bin/bootstrap-docbase.sh
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export CATALINA_TMPDIR=/usr/local/tomcat/temp
|
|||
|
||||
runtime_root="/usr/local/tomcat/webapps/ROOT"
|
||||
workspace_www="/workspace/www"
|
||||
workspace_rus="/workspace/rus"
|
||||
|
||||
rm -rf "$runtime_root"
|
||||
mkdir -p "$runtime_root"
|
||||
|
|
@ -22,6 +23,11 @@ done
|
|||
mkdir -p "$runtime_root/WEB-INF"
|
||||
cp -a "$workspace_www/WEB-INF/." "$runtime_root/WEB-INF/"
|
||||
|
||||
if [ -d "$workspace_rus/WEB-INF/classes" ]; then
|
||||
mkdir -p "$runtime_root/WEB-INF/classes"
|
||||
cp -a "$workspace_rus/WEB-INF/classes/." "$runtime_root/WEB-INF/classes/"
|
||||
fi
|
||||
|
||||
mkdir -p /usr/local/tomcat/conf/Catalina/localhost
|
||||
cat > /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml <<'EOF'
|
||||
<Context>
|
||||
|
|
@ -31,6 +37,30 @@ EOF
|
|||
|
||||
/usr/local/bin/bootstrap-docbase.sh
|
||||
|
||||
wait_for_mysql() {
|
||||
local host="${LOCAL_DB_HOST:-mysql}"
|
||||
local port="${LOCAL_DB_PORT:-3306}"
|
||||
local database="${LOCAL_DB_NAME:-pg}"
|
||||
local user="${LOCAL_DB_USER:-root}"
|
||||
local password="${LOCAL_DB_PASSWORD:-root}"
|
||||
local attempts=60
|
||||
|
||||
for ((attempt=1; attempt<=attempts; attempt++)); do
|
||||
if mysql --protocol=TCP -h "$host" -P "$port" -u"$user" -p"$password" -D "$database" -Nse "SELECT 1 FROM parm WHERE codice = 'REWRITE_URL_ENABLE' LIMIT 1" >/dev/null 2>&1; then
|
||||
echo "MySQL is ready for legacy app startup"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Waiting for MySQL readiness ($attempt/$attempts)"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "MySQL did not become ready for legacy app startup" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_mysql
|
||||
|
||||
patch_context_param() {
|
||||
local param_name="$1"
|
||||
local param_value="$2"
|
||||
|
|
@ -42,6 +72,6 @@ patch_context_param database "//${LOCAL_DB_HOST:-mysql}/${LOCAL_DB_NAME:-pg}"
|
|||
patch_context_param catalog "${LOCAL_DB_NAME:-pg}"
|
||||
patch_context_param user "${LOCAL_DB_USER:-root}"
|
||||
patch_context_param password "${LOCAL_DB_PASSWORD:-root}"
|
||||
patch_context_param instance "${LOCAL_APP_INSTANCE:-local-model}"
|
||||
patch_context_param instance "${LOCAL_APP_INSTANCE:-main}"
|
||||
|
||||
exec catalina.sh run
|
||||
Loading…
Add table
Add a link
Reference in a new issue