Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shadrix's avatar
Level 12

GitLab CI: Do you put your MIX_keys into .env.exampe?

Hey :) so I read a lot about GitLab CI and how you can deploy your server. However, now I noticed that there might be a small problem. Wenn GitLab is running npm run production it compiles the code with the MIX_<variables>.

Normally, I would not put the API keys in .env.example, but in this case does it really matter, because you can read out the keys anyway by looking into the javascript code?

0 likes
2 replies
davy_yg's avatar

You can call the GITLAB_KEY that you put in .env just by typing:

env('GITLAB_KEY')

.env

GITLAB_KEY=DA12321ffsdfdaeer1312ForExample
shadrix's avatar
Level 12

I think you didn't understand my question or maybe I didn't understand your answer.

So let's go to: https://github.com/laravel/laravel/blob/master/.env.example

At the very bottom you will see:

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

How could you tell GitLab the PUSHER_APP_KEY when using it in a docker enviroment?

Please or to participate in this conversation.