Skip to content

Having issues passing environment variables to Laravel #82

Answered by jaydrogers
alexjustesen asked this question in Q&A
Discussion options

You must be logged in to vote

Whoa dude, this was SUPER HELPFUL!

All that effort in isolating it to a brand new Laravel install paid off troubleshooting this.

How I was able to replicate

Once I added the auto migrations, then I was able to replicate the issue: jaydrogers/laravel-env-test@4438f2d?short_path=b335630#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

The problem

In my script, I had a su - webuser in my"laravel-automations" script, which was running commands as webuser but not passing the environment variables from the container 🙃

The Solution

I just pushed a commit (b0716db) that utilizes the s6-setuidgid command, which properly passes the environment and switches users "The S6 Way".

N…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@alexjustesen
Comment options

Comment options

You must be logged in to vote
1 reply
@alexjustesen
Comment options

Answer selected by jaydrogers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants