Handing secrets in PHP Docker Compose site

If you’re using a single instance server (not Docker Swarm) and Docker Compose, but want to keep your secrets out of source control it’s not too bad. First, make sure you’re excluding “.env” in your .gitignore…

.env

Then, add your secrets to a .env file (file name must be exactly .env) in the same folder as your docker-compose.yml…

SEC_1=Something
SEC_2=SomethingElse

Then, be sure to expose your secrets in the “environment:” section of your docker-compose…

    environment:
      SEC_1: ${SEC_1}
      SEC_2: ${SEC_2}

Upload both the .env and docker-compose.yml to the server, and restart docker to pick up the env vars…

docker compose down
docker compose up -d

And finally, use the values in your PHP…

getenv('SEC_1')

Oh yeah, and since your .env won’t be in source control I’d still recommend finding a secure place to save it like a password manager.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

State gun control laws reduce children’s firearm deaths, study shows

Check out this article: State gun control laws reduce children’s firearm deaths, study shows

“If more guns made us safer, the US would be the safest country in the world by far. Instead, we have a homicide rate that’s 25 times that of our peer nations.”

Note: Since this is an automatically created post there is no commentary on it other than any minimal notes I may have included. Read it and do your own critical thinking. I may get around to adding some/more of my own thoughts or categorizing it… but maybe not. Should the article be behind a paywall let me know and I will figure out a way to get it to you.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

If you are useful, it doesn’t mean you are valued

Check out this article: If you are useful, it doesn’t mean you are valued

Note: Since this is an automatically created post there is no commentary on it other than any minimal notes I may have included. Read it and do your own critical thinking. I may get around to adding some/more of my own thoughts or categorizing it… but maybe not. Should the article be behind a paywall let me know and I will figure out a way to get it to you.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

By Default Signal Doesn’t Recall

Check out this article: By Default Signal Doesn’t Recall

Just another reason I love Signal so much

Note: Since this is an automatically created post there is no commentary on it other than any minimal notes I may have included. Read it and do your own critical thinking. I may get around to adding some/more of my own thoughts or categorizing it… but maybe not. Should the article be behind a paywall let me know and I will figure out a way to get it to you.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

How Linux is built with Greg Kroah-Hartman

Check out this article: How Linux is built with Greg Kroah-Hartman

Interesting how one of the largest (if not the largest) open source projects manages things.

Note: Since this is an automatically created post there is no commentary on it other than any minimal notes I may have included. Read it and do your own critical thinking. I may get around to adding some/more of my own thoughts or categorizing it… but maybe not. Should the article be behind a paywall let me know and I will figure out a way to get it to you.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.