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
Docs: Add Fly.io deployment guide #982
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Posting the link here for simplicity: https://documentation-git-fork-bogdaaamn-docs-fly-deplo-460c6b-strapijs.vercel.app/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/fly.html I'm not used to Strapi but just read it and that's really awesome work, well done @bogdaaamn |
Looks great to me! |
Thank you very much for creating this @bogdaaamn, and apologies for my late reply. |
I followed these instructions from scratch and everything seemed to work right up until the very end. Once I used
But of course, I can't access the administrator panel using The guide says "continue using Strapi as you would normally do, or follow the Quick Start Guide - Strapi Developer Docs." So I visited the Quick Start Guide, and the very first step is Fly.io seems to be unhappy:
Ultimately, the deploy fails with:
And under Monitoring, about 5 minutes after starting the VM, I see this:
And yet, on the Overview of the app, it says the container is "Running" and it's green. I'm not sure at this point if I've done something wrong, or if this is expected and I just need to follow some different set of steps. When I try the last step in the guide and attempt to run a local copy to test with, I get this error:
My guess is that this is unrelated, since it seems to actually start running on Fly.io, but I thought I should mention it. (And I haven't figured out a solution yet.) UPDATE: I have successfully gotten Strapi running locally using So my feedback is: it would be helpful for the guide to explain the state your environment should be in at the end (maybe with a Fly.io screenshot?), and give more precise instructions on where to go next to continue setup. And maybe some troubleshooting steps for common issues. |
@nk9 I'm not used t Stripe but I think I have a guess that the reason it's erroring for failing allocations is that your fly.toml listens to a port different to 8080. You logs say your server is on port 8080, the So we don't spam this PR I'd suggest you bring that message to https://community.fly.io/ where we can help you debug this :) |
Indeed, the problem is that the generated [env]
PORT = "8080" That's setting Strapi to listen on port 8080, but the Dockerfile exports 1337 and the Also, as @lubien pointed out in the fly.io community thread, the Dockerfile is using a node base image, and so there's no need for this part of the
And in fact, when I removed that, Strapi actually built differently. (A local Lastly, I see that the Docker image produced by this Dockerfile is 2.8GB.
That seems extremely chunky! Would it be possible to employ multi-stage builds to trim that down? And possibly a slimmer base image like |
Hello @bogdaaamn, Thank you for your contribution. We are moving community deployment guides to the forum. In the next few days, I will move your guide there and close this PR. Thanks again for your contribution to the Strapi project. |
Thank you @StrapiShaun! Noted. There are a few changes I would like to make, but I will wait for the migration and then figure out the best way to do it |
@bogdaaamn The guide is now in the community forum. I had to make some formatting changes since the callouts and code groups from the documentation do not work in the forum. Thanks for your contribution and please let me know if you have any questions. |
What does it do?
Added a deployment guide for Fly.io and Postgres. Pinging the Fly folks just in case they have better solutions to this @michaeldwan @jeromegn @lubien @ThisIsRahmat
Why is it needed?
n/a
Related issue(s)/PR(s)
n/a