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
This commit is contained in:
17
packages/twenty-docker/prod/twenty/entrypoint.sh
Executable file
17
packages/twenty-docker/prod/twenty/entrypoint.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/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 "$@"
|
||||
Reference in New Issue
Block a user