Files
Homarr/scripts/run.sh

31 lines
883 B
Bash
Raw Normal View History

# Run migrations
if [ $DB_MIGRATIONS_DISABLED = "true" ]; then
echo "DB migrations are disabled, skipping"
else
echo "Running DB migrations"
node ./db/migrations/$DB_DIALECT/migrate.cjs ./db/migrations/$DB_DIALECT
fi
# Auth secret is generated every time the container starts as it is required, but not used because we don't need JWTs or Mail hashing
export AUTH_SECRET=$(openssl rand -base64 32)
# Start nginx proxy
# 1. Replace the HOSTNAME in the nginx template file
# 2. Create the nginx configuration file from the template
# 3. Start the nginx server
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
nginx -g 'daemon off;' &
# Start Redis
redis-server /app/redis.conf &
# Run the tasks backend
node apps/tasks/tasks.cjs &
node apps/websocket/wssServer.cjs &
# Run the nextjs server
2024-05-16 21:26:07 +02:00
node apps/nextjs/server.js & PID=$!
wait $PID