react-logo/misc/containers/backend/docker-entrypoint.sh

21 lines
546 B
Bash

#!/bin/bash
FIRST_RUN_FLAG_FILE="/.first-run"
if [ ! -e "$FIRST_RUN_FLAG_FILE" ]; then
echo "Installing dependencies. Please wait..."
composer install
echo "Waiting for database..."
wait-for-it database:3306 -- echo "Database is up !"
echo "Applying database migrations. Please wait..."
bin/console doctrine:migrations:migrate --no-interaction
echo "Loading fixtures. Please wait..."
bin/console doctrine:fixtures:load --no-interaction
touch "$FIRST_RUN_FLAG_FILE"
fi
bin/console server:run 0.0.0.0:8001