fix: adds build step to the database package for optimizing docker build (#5970)

Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com>
This commit is contained in:
Anshuman Pandey
2025-07-02 09:12:01 +05:30
committed by GitHub
parent 979fd71a11
commit 2c34f43c83
16 changed files with 209 additions and 71 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
export NODE_ENV=production
if [ "${DOCKER_CRON_ENABLED:-1}" = "1" ]; then
echo "Starting cron jobs...";
supercronic -quiet /app/docker/cronjobs &
else
echo "Docker cron jobs are disabled via DOCKER_CRON_ENABLED=0";
fi;
(cd packages/database && npm run db:migrate:deploy) &&
(cd packages/database && npm run db:create-saml-database:deploy) &&
exec node apps/web/server.js
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
if [ -f "/run/secrets/database_url" ]; then
export DATABASE_URL=$(cat /run/secrets/database_url)
else
echo "DATABASE_URL secret not found. Build may fail if this is required."
fi
if [ -f "/run/secrets/encryption_key" ]; then
export ENCRYPTION_KEY=$(cat /run/secrets/encryption_key)
else
echo "ENCRYPTION_KEY secret not found. Build may fail if this is required."
fi
exec "$@"