Merge pull request #21 from krumIO/startup-env

Remove hardcoded database url and add DATABASE_HOST variable
This commit is contained in:
Alex van Andel 2021-10-23 23:02:44 +01:00 committed by GitHub
commit 9d8802b195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

3
.env
View File

@ -1,7 +1,8 @@
POSTGRES_USER=unicorn_user POSTGRES_USER=unicorn_user
POSTGRES_PASSWORD=magical_password POSTGRES_PASSWORD=magical_password
POSTGRES_DB=calendso POSTGRES_DB=calendso
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}" DATABASE_HOST=db:5432
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}"
GOOGLE_API_CREDENTIALS='secret' GOOGLE_API_CREDENTIALS='secret'
BASE_URL='http://localhost:3000' BASE_URL='http://localhost:3000'
NEXTAUTH_URL='http://localhost:3000' NEXTAUTH_URL='http://localhost:3000'

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -x set -x
/app/scripts/wait-for-it.sh db:5432 -- echo "db is up" /app/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "db is up"
npx prisma db push npx prisma db push
yarn start yarn start