-
-
Notifications
You must be signed in to change notification settings - Fork 365
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Issue running docker in production mode #1137
Comments
Production mode has additional checks (they are cached, overall behaviour may one day change under #630). As for the issue you are seeing, it sounds like the permissions were changed in a "wrong" manner. Without seeing the command used to change the permissions (and the context they are run in) I can't help much. To hazard a guess, it looks like the permission change has blocked the user account within the container context. That is, there is an ownership issue. From memory there are some considerations for setting file permissions in a |
Thanks for the detailed answer. Just out of curiosity, under the dev mode, is it possible to enable logs to stderr from php-fpm in the container As per your second paragraph's answer, I may have broken something as I got stuck with this for few hours and tried few things. I have deployed the solution from scratch again and ended up with the same issue when hitting localhost:8591:
Not sure if someone can point me to the right direction here. The folder permissions from the
|
Dev mode is generally a lot more permissive (e.g. allowing certain folders to be writable). Production on the other hand has checks in place intended to guard against potential security issues. They aren't comprehensive, being more intended to push people into using best security practises rather than providing another layer of security. My mastery of Unix permissions is non-existent so I'll defer to @lcharette on this front. |
@raserma |
Maybe @phillmac could help ? |
E.g. My dockerfile looks something like this:
The only caveat to this approach is needing to manage asset bundles separately e.g.
where the .sh script looks something like this:
|
The end result is a bunch of switching users and messing about, but the critical thing is running |
The final stage of my docker build looks something like this:
|
I really should move the asset builds to separate stage to cut down on the weight of nodejs I guess, But seeing as I use the same image for both dev and production, being able to quickly add assets in dev for the sake of testing is kinda handy too |
Thank you guys! @phillmac thanks for the Dockerfiles. I think I also executed those chmod/chown commands when debugging the container and nothing changed. However I will try these steps all over again later with a fresher brain in case I missed something. |
FYI, there is an
|
@lcharette Thoughts on converting this into a discussion? (the GitHub feature that is) |
I agree, we can try. Docker seems a complex topic not it's own that might or no have a definitive answer. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi,
We got Userfrosting running on our systems and I'd like to migrate it to Docker.
So I am trying to deploy Userfrosting in docker using the UF_MODE=production. However, after the installation, the frontend application fails with:
I have tried to give those folders read-only permissions, but then the frontend fails with the following:
Am I supposed to run production mode with Docker?
If I switch back to
development
mode before making those folder read-only, and restart the container, the portal loads successfully and I am able to login. However, with development mode enabled, theapp
container doesn't log anything from php-fpm service, which is not ideal.The text was updated successfully, but these errors were encountered: