Relative Content

Tag Archive for dockerdocker-composedockerfileenvironment-variables

Handling secret env variables in Docker container via GitHub Actions

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.