Skip to content

Commit

Permalink
fix: Entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Jan 17, 2023
1 parent 9b96c2f commit 2e09f3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/sh

if [[ -z "${CONNECTION_STRING}" ]]; then
if [ -z "${PG_COMPONENT_PSQL_USER}" ] || [ -z "${PG_COMPONENT_PSQL_PASSWORD}" ] || [ -z "${PG_COMPONENT_PSQL_HOST}" ] || [ -z "${PG_COMPONENT_PSQL_PORT}" ] || [ -z "${PG_COMPONENT_PSQL_DATABASE}" ]; then
# Either the connection string or the individual DB encironenment variables must be set.
echo "Error: Either the connection string or the individual DB encironenment variables must be set."
exit 1
fi
export CONNECTION_STRING=postgres://${PG_COMPONENT_PSQL_USER}:${PG_COMPONENT_PSQL_PASSWORD}@${PG_COMPONENT_PSQL_HOST}:${PG_COMPONENT_PSQL_PORT}/${PG_COMPONENT_PSQL_DATABASE}
fi

npm run migrate:docker up || exit 1
node --inspect="0.0.0.0:9229" ./dist/src/server.js || exit 1

0 comments on commit 2e09f3f

Please sign in to comment.