Deploying on render.com #993
Replies: 3 comments 7 replies
-
|
Try setting the |
Beta Was this translation helpful? Give feedback.
-
|
Ok, have found the issue. Running either: Is making the system-level env vars inaccessible for some reason 🤷 Taking these out and FrankenPHP starts as expected, with Render doing the HTTPS termination. |
Beta Was this translation helpful? Give feedback.
-
|
I think this is probably caused by when If those commands run during the Docker image build, Laravel writes the resolved config values into That would explain why Laravel’s docs mention that after config is cached, the So I think one fix is to avoid running these during RUN php artisan config:cache
RUN php artisan optimizeand instead run them after the container has started with the real production env vars available, unless you explicitly make those vars available at build time. I would usually avoid running migrations during the image build for the same reason: RUN php artisan migrate --forceMigrations should usually happen at deploy/startup time, when the production database env vars are available and the new code that depends on those migrations is being deployed. Otherwise, there could be a significant gap between image build and deploy where the database has already been changed but the old code is still running. Using a Caddy module such as caddy-exec might be one way to run startup commands, and FrankenPHP documents how to build custom Caddy modules here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Hi there,
I'm trying to get a pretty standard Laravel app deployed on a Render web service instance.
Here's my Dockerfile:
Locally, if I run (from the docs):
docker run -p 80:80 -p 443:443 -p 443:443/udp -v $PWD:/app dunglas/frankenphpEverything works as expected.
On Render, when I deploy everything seems to build and start correctly, I even get the default Laravel uptime endpoint (
/up) returning something positive as the healthcheck passes, however if I try to visit the site in a browser I get the "TOO MANY REDIRECTS" error.I've tried clearing my cookies, different browsers and tweaking the ports exposed but nothing seems to help. I don't really have anything special set up in the environment as shown below:
I think the issue might be something to do with the default port binding and/or proxying from HTTPS -> HTTP but I don't know enough about this to get it working.
Any ideas welcomed! Thanks in advance
Build Type
Docker (Debian Bookworm)
Worker Mode
No
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output
No response
Beta Was this translation helpful? Give feedback.
All reactions