From 3fc061ff1bc9380240d78673a9ecf559c599aaa0 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Wed, 5 Jan 2022 14:00:50 +0200 Subject: [PATCH] Add DATABASE_URL to build, simplify start script --- Dockerfile | 1 + scripts/start.sh | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 52f765f..c1d596e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ FROM node:14 as builder WORKDIR /app ENV BASE_URL=https://calendso.example.com ENV NEXT_PUBLIC_APP_URL=https://calendso.example.com +ENV DATABASE_URL=postgresql://POSTGRESQL COPY calendso . diff --git a/scripts/start.sh b/scripts/start.sh index 3c7e2d7..6cf91ff 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,12 +1,6 @@ #!/bin/sh set -x -# Set environment variables -echo BASE_URL $BASE_URL -echo NEXT_PUBLIC_APP_URL "$NEXT_PUBLIC_APP_URL" -find \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#https://calendso.example.com#$NEXT_PUBLIC_APP_URL#g" -find \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#https://calendso.example.com#$BASE_URL#g" - -/app/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up" +/app/scripts/wait-for-it.sh ${POSTGRES_HOST} -- echo "database is up" npx prisma migrate deploy yarn start