Szakdolgozat/backend/docker.sh
NorbiPeti aa6f3f51de
Fix backend production deploy and database connection
- Fixed database URL locally and in production
- Set separate DB user just to be safe
- Migrate DB schema on each launch
- Use node user during dev but use root during deploy
- Fix output of the dev container (tsc-watch --noClear)
2021-11-15 22:47:41 +01:00

23 lines
580 B
Bash

#!/usr/bin/env bash
set -e
if [ "$COMMAND" == "deploy" ]; then
echo Building Docker image
docker build -t registry.heroku.com/np-szakdolgozat/web -f Dockerfile-prod .
echo Logging in to Heroku
heroku login
echo Logging in to Container Registry
heroku container:login
echo Pushing image
docker push registry.heroku.com/np-szakdolgozat/web
echo Releasing new version
heroku container:release web -a np-szakdolgozat
exit 0
fi
echo "Installing packages"
npm install
echo "Running application"
npm run rebuild
wait-for-it database:3306 -t 0
npm run start:watch