How can I dockerize an .env file while keeping the variables secret? I have an .env file that is hidden by a .gitignore and .dockerignore. I have an .env file that is hidden by a .gitignore and .dockerignore.I’ve tried using a volume that accesses the file via docker-compose, but that only works if I remove .env from .dockerignore. I’ve also tried storing my variables in GitHub Actions secrets and accessing them through env: USE: ${{ secrets.USE }} without docker-compose at all, but that doesn’t work either.
Kind of scratching my head here (more like bashing it through the screen). How are you supposed to keep these secret if the program needs them to run? Ultimately, I would like GitHub Actions to handle the Docker compile and deployment to AWS via pushes, but struggling to get the Docker to work correctly at this point..
Thank you!