2024-03-16 15:51:34 +01:00
|
|
|
# Run migrations
|
2024-09-26 18:54:28 +02:00
|
|
|
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
|
2024-03-16 15:51:34 +01:00
|
|
|
|
2024-12-31 11:30:29 +01:00
|
|
|
# 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)
|
2024-12-17 19:10:19 +01:00
|
|
|
|
2024-09-16 18:10:58 +02:00
|
|
|
# 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;' &
|
|
|
|
|
|
2024-03-25 21:09:40 +01:00
|
|
|
# Start Redis
|
2024-05-12 16:28:44 +02:00
|
|
|
redis-server /app/redis.conf &
|
2024-03-25 21:09:40 +01:00
|
|
|
|
2024-04-07 11:32:29 +02:00
|
|
|
# Run the tasks backend
|
|
|
|
|
node apps/tasks/tasks.cjs &
|
|
|
|
|
|
|
|
|
|
node apps/websocket/wssServer.cjs &
|
2024-03-16 15:51:34 +01:00
|
|
|
|
|
|
|
|
# Run the nextjs server
|
2024-05-16 21:26:07 +02:00
|
|
|
node apps/nextjs/server.js & PID=$!
|
|
|
|
|
|
|
|
|
|
wait $PID
|