Currently when using local development or a potential docker compose production deploy on an EC2 instance, for example, the database is initialized from the packages/api/initdb.d scripts. However, deployment to AWS via copilot does not run these initialization scripts because an Aurora Postgres cluster is used, so in that case node packages/api/dist/initDb.js is used.
Find a way to have one location for the initialization logic, so that I don't have to manage keeping the two in sync. Easy thought is to have psql installed on the api container and then put it all in a shell script to execute, but that would add some bloat to the image size, and other tradeoffs I'm sure.
Currently when using local development or a potential docker compose production deploy on an EC2 instance, for example, the database is initialized from the
packages/api/initdb.dscripts. However, deployment to AWS via copilot does not run these initialization scripts because an Aurora Postgres cluster is used, so in that casenode packages/api/dist/initDb.jsis used.Find a way to have one location for the initialization logic, so that I don't have to manage keeping the two in sync. Easy thought is to have psql installed on the
apicontainer and then put it all in a shell script to execute, but that would add some bloat to the image size, and other tradeoffs I'm sure.