-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix Heroku deployment guide #1591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The old server.js proposed doesn't work, please update with the following: module.exports = ({ env }) => ({ proxy: true, host: "0.0.0.0", port: process.env.PORT, url: env('MY_HEROKU_URL'), app: { keys: env.array('APP_KEYS') }, admin: { auth: { secret: env('ADMIN_JWT_SECRET'), }, }, })
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
}, | ||
}); | ||
proxy: true, | ||
host: "0.0.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could also set this as a env
not that it needs to change.
But it would make it more dynamic.
We are also using process.env.PORT
where we could make it more standard to say env("PORT")
IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, problem is that the environment variables are set in the HEROKU settings dashboard, the current solution doesnt work when deploying the app in Heroku but it givves the following error:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
while the proposed change it works at least on Strapi version > 4.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @peppix2010!
It's approved, merged, should be live on docs.strapi.io in a few minutes, and will be mentioned in the next weekly snapshot release.
The old server.js proposed doesn't work, please update with the following: module.exports = ({ env }) => ({
proxy: true,
host: "0.0.0.0",
port: process.env.PORT,
url: env('MY_HEROKU_URL'),
app: {
keys: env.array('APP_KEYS')
},
admin: {
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
},
})
What does it do?
Describe the technical changes you did.
Why is it needed?
Describe the issue you are solving.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request