File tree Expand file tree Collapse file tree 3 files changed +13
-26
lines changed
Expand file tree Collapse file tree 3 files changed +13
-26
lines changed Original file line number Diff line number Diff line change @@ -147,4 +147,4 @@ COPY --chmod=755 ./check-mysql.sh /usr/local/bin/
147147COPY --chmod=755 ./check-pushtx.sh /usr/local/bin/
148148COPY --chmod=755 ./check-soroban.sh /usr/local/bin/
149149COPY --chmod=755 ./functions.sh /usr/local/bin/
150- COPY --chmod=755 ./samourai-dojo/docker/my-dojo/soroban/restart.sh /usr/local/bin/soroban-restart.sh
150+ COPY --chmod=755 ./samourai-dojo/docker/my-dojo/soroban/restart.sh /usr/local/bin/soroban-restart.sh
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ MYSQL_DATABASE=${MYSQL_DATABASE:-"samourai-main"}
2525MYSQL_USER=${MYSQL_USER:- " samourai" }
2626MYSQL_PASSWORD=${MYSQL_PASSWORD:- " samourai" }
2727
28- if [ ! -f /var/lib/mysql/.dojo_db_initialized ]; then
28+ if [ ! -d /var/lib/mysql/mysql ]; then
2929 echo " [i] MySQL data directory not found or not initialized, creating initial DBs"
3030
3131 mkdir -p /var/lib/mysql
7777 echo
7878 echo ' MySQL init process done. Starting mysqld...'
7979 echo
80-
81- # Run initial SQL scripts
82- sed " 1iUSE \` $MYSQL_DATABASE \` ;" /docker-entrypoint-initdb.d/2_update.sql | /usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0
83-
84- for f in /docker-entrypoint-initdb.d/* ; do
85- case " $f " in
86- * .sql) echo " $0 : running $f " ; sed " 1iUSE \` $MYSQL_DATABASE \` ;" " $f " | /usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0; echo ;;
87- * ) echo " $0 : ignoring or entrypoint initdb empty $f " ;;
88- esac
89- echo
90- done
91-
92- touch /var/lib/mysql/.dojo_db_initialized
9380else
9481 echo " [i] MySQL data directory already initialized, skipping initial DB creation."
9582fi
9683
84+ # Migrate database tables
85+ echo " [i] Running database migration..."
86+ for f in /docker-entrypoint-initdb.d/* ; do
87+ case " $f " in
88+ * .sql) echo " $0 : running $f " ; sed " 1iUSE \` $MYSQL_DATABASE \` ;" " $f " | /usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0; echo ;;
89+ * ) echo " $0 : ignoring or entrypoint initdb empty $f " ;;
90+ esac
91+ echo
92+ done
93+
9794# Start mysql
9895/usr/bin/mysqld_safe --user=mysql --datadir=' /var/lib/mysql' &
9996db_process=$!
Original file line number Diff line number Diff line change @@ -70,22 +70,12 @@ health-checks:
7070 inject : true
7171 system : false
7272 io-format : yaml
73- soroban :
74- name : Soroban
75- success-message : Soroban P2P relay service is online and ready
76- type : docker
77- image : main
78- entrypoint : ' check-soroban.sh'
79- args : []
80- inject : true
81- system : false
82- io-format : yaml
8373 soroban :
8474 name : Soroban
8575 success-message : Soroban is running
8676 type : docker
8777 image : main
88- entrypoint : " check-soroban.sh"
78+ entrypoint : ' check-soroban.sh'
8979 args : []
9080 inject : true
9181 system : false
You can’t perform that action at this time.
0 commit comments