Renamed file

This commit is contained in:
Dennis Postma 2025-02-07 22:53:38 +01:00
parent e824f0f558
commit 5f02aca6e4
2 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,7 @@ RUN mkdir -p /run/mysqld /var/lib/mysql && \
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY package*.json ./ COPY package*.json ./
COPY docker-start.sh ./start.sh COPY start.sh ./start.sh
COPY . . COPY . .
RUN npm ci --only=production && \ RUN npm ci --only=production && \

View File

@ -10,7 +10,7 @@ cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
tmux kill-session -t $APP_NAME 2>/dev/null || true tmux kill-session -t $APP_NAME 2>/dev/null || true
redis-cli shutdown || true redis-cli shutdown || true
mariadb-admin -u root shutdown || true mysqladmin -u root shutdown || true
exit 0 exit 0
} }
@ -25,23 +25,23 @@ if ! redis-cli ping > /dev/null 2>&1; then
exit 1 exit 1
fi fi
# Start MariaDB # Start MySQL
echo "Starting MariaDB..." echo "Starting MySQL..."
mariadbd --user=mysql --datadir=/var/lib/mysql & mysqld --user=mysql --datadir=/var/lib/mysql &
# Wait for MariaDB with timeout # Wait for MySQL with timeout
echo "Waiting for MariaDB to be ready..." echo "Waiting for MySQL to be ready..."
COUNTER=0 COUNTER=0
while ! mariadb-admin ping -h localhost --silent; do while ! mysqladmin ping -h localhost --silent; do
if [ $COUNTER -gt $MAX_MYSQL_WAIT ]; then if [ $COUNTER -gt $MAX_MYSQL_WAIT ]; then
echo "MariaDB failed to start within $MAX_MYSQL_WAIT seconds" echo "MySQL failed to start within $MAX_MYSQL_WAIT seconds"
exit 1 exit 1
fi fi
echo "Still waiting..." echo "Still waiting..."
sleep 2 sleep 2
COUNTER=$((COUNTER+2)) COUNTER=$((COUNTER+2))
done done
echo "MariaDB is ready!" echo "MySQL is ready!"
# Run migrations with error handling # Run migrations with error handling
echo "Running database migrations..." echo "Running database migrations..."
@ -61,8 +61,8 @@ while true; do
echo "Redis died" echo "Redis died"
exit 1 exit 1
fi fi
if ! mariadb-admin ping -h localhost --silent; then if ! mysqladmin ping -h localhost --silent; then
echo "MariaDB died" echo "MySQL died"
exit 1 exit 1
fi fi
if ! tmux has-session -t $APP_NAME 2>/dev/null; then if ! tmux has-session -t $APP_NAME 2>/dev/null; then