fix: deployment setup to Heroku (#1834)

* fix: move app.json to root directory

* fix: add heroku-postbuild script

* chore: add description to env variables on app.json

* fix: update postdeploy script on app.json

* fix: add Procfile to override start script

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Arthur Denner 2022-02-14 17:29:48 +01:00 committed by GitHub
parent b7ad073de9
commit 691235f874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 20 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: npx turbo run @calcom/web#start

26
app.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "Cal.com",
"description": "Open Source Scheduling",
"repository": "https://github.com/calcom/cal.com",
"logo": "https://cal.com/android-chrome-512x512.png",
"keywords": ["react", "typescript", "node", "nextjs", "prisma", "postgres", "trpc"],
"addons": [
{
"plan": "heroku-postgresql:hobby-dev"
}
],
"env": {
"BASE_URL": {
"description": "Replace HEROKU_APP_NAME with the name given to your app",
"value": "https://HEROKU_APP_NAME.herokuapp.com"
},
"CALENDSO_ENCRYPTION_KEY": {
"description": "Application Key for symmetric encryption and decryption. Must be 32 bytes for AES256 encryption algorithm.",
"value": "secret"
},
"JWT_SECRET": "secret"
},
"scripts": {
"postdeploy": "cd apps/web && npx prisma migrate deploy"
}
}

View File

@ -1,20 +0,0 @@
{
"name": "Cal.com",
"description": "Open Source Scheduling",
"repository": "https://github.com/calcom/cal.com",
"logo": "https://cal.com/android-chrome-512x512.png",
"keywords": ["react", "typescript", "node", "nextjs", "prisma", "postgres", "trpc"],
"addons": [
{
"plan": "heroku-postgresql:hobby-dev"
}
],
"env": {
"BASE_URL": "https://${HEROKU_APP_NAME}.herokuapp.com",
"CALENDSO_ENCRYPTION_KEY": "32-random-string",
"JWT_SECRET": "secret"
},
"scripts": {
"postdeploy": "npx prisma migrate deploy"
}
}

View File

@ -15,6 +15,7 @@
"dev": "turbo run dev --parallel",
"dx": "turbo run dx",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"heroku-postbuild": "turbo run @calcom/web#build",
"lint": "turbo run lint",
"prepare": "husky install",
"start": "turbo run start",

View File

@ -49,6 +49,7 @@
],
"outputs": [".next/**"]
},
"@calcom/web#start": {},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]