Files
twenty_crm/packages/twenty-docker/prod/twenty/entrypoint.sh
Quentin G 1aa48d3bf7 feat: merge front and server dockerfiles and optimize build (#4589)
* feat: merge front and server dockerfiles and optimize build

* fix: update image label

* fix: bring back support for REACT_APP_SERVER_BASE_URL injection at runtime

* fix: remove old entries & add nx cache in dockerignore

* feat: generate frontend config at runtime using Nest

* fix: format and filename

* feat: use the EnvironmentService and leave default blank

* feat: add support for DB migrations
2024-03-21 19:22:21 +01:00

18 lines
546 B
Bash
Executable File

#!/bin/sh
# Check if the initialization has already been done and that we enabled automatic migration
if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/${STORAGE_LOCAL_PATH}/db_initialized ]; then
echo "Running database setup and migrations..."
# Run setup and migration scripts
npx ts-node ./scripts/setup-db.ts
yarn database:migrate:prod
# Mark initialization as done
echo "Successfuly migrated DB!"
touch /app/${STORAGE_LOCAL_PATH}/db_initialized
fi
# Continue with the original Docker command
exec "$@"