Update docker build process

This commit is contained in:
anthorob committed 2024-05-09 15:34:41 -04:00
1 parent f79ab8984a
commit fa93bf6af4
3 files changed
+24 -19

No files matched your search

+8 -8
View File
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh
function prop {
prop() {
grep "${1}" bot.properties | cut -d'=' -f2
}
function _term() {
_term() {
echo "Caught SIGTERM/SIGINT signal, graceful shutdown of bot.."
if [ -z "$pid" ]; then
echo "Bot isn't running, exiting."
@@ -16,10 +16,10 @@ function _term() {
fi
}
trap _term SIGTERM
trap _term SIGINT
trap _term TERM
trap _term INT
if [ ! -f /bin/nc ]; then
if [ ! -f /usr/bin/nc ]; then
echo "nc not found. Exiting."
exit 1
fi
@@ -40,9 +40,9 @@ echo "Waiting 10 seconds for database to start.."
sleep 10
echo "Checking if MySQL / MariaDB is started.."
if /bin/nc -z "$MYSQL_HOST" "$MYSQL_PORT"; then
if /usr/bin/nc -z "$MYSQL_HOST" "$MYSQL_PORT"; then
echo "Database OK. Starting bot..";
/usr/local/openjdk-17/bin/java -jar target/netneutrality-jar-with-dependencies.jar &
/opt/java/openjdk/bin/java -jar /app/netneutrality-jar-with-dependencies.jar &
pid=$!
wait "$pid"