build: fix default values in startup script for docker

This commit is contained in:
anthorob committed 2024-07-16 21:17:18 -04:00
1 parent 5fb29ea4ed
commit 4378321c65
2 files changed
+3 -6

No files matched your search

+1
View File
@@ -27,6 +27,7 @@ services:
- ./logs:/app/logs - ./logs:/app/logs
environment: environment:
MYSQL_HOST: 'db' MYSQL_HOST: 'db'
MYSQL_PORT: '3306'
MYSQL_USER: 'java' MYSQL_USER: 'java'
MYSQL_PASSWORD: 'password' MYSQL_PASSWORD: 'password'
MYSQL_DATABASE: 'netneutrality' MYSQL_DATABASE: 'netneutrality'
+2 -6
View File
@@ -1,9 +1,5 @@
#!/bin/sh #!/bin/sh
prop() {
grep "${1}" bot.properties | cut -d'=' -f2
}
_term() { _term() {
echo "Caught SIGTERM/SIGINT signal, graceful shutdown of bot.." echo "Caught SIGTERM/SIGINT signal, graceful shutdown of bot.."
if [ -z "$pid" ]; then if [ -z "$pid" ]; then
@@ -29,11 +25,11 @@ if [ -z $API_PORT ]; then
fi fi
if [ -z $MYSQL_HOST ]; then if [ -z $MYSQL_HOST ]; then
MYSQL_HOST="$(prop 'MYSQL_HOST')" MYSQL_HOST="localhost"
fi fi
if [ -z $MYSQL_PORT ]; then if [ -z $MYSQL_PORT ]; then
MYSQL_PORT=$(prop 'MYSQL_PORT') MYSQL_PORT=3306
fi fi
echo "Waiting 10 seconds for database to start.." echo "Waiting 10 seconds for database to start.."