It looks like since the RUN command is already sourcing the .env file, it's not necessary to include it in the docker-compose file. This leaves us without any way to supply runtime variables, but I don't imagine I'll be adding any runtime environment variables soon.
The end result is that docker-compose runs without any error if no .env file is present, so there's no need for any scripts to autocreate a .env file.
Btw I've added a GitHub action to docker-compose build so we catch any future regressions. This action could potentially be expanded to publish to dockerhub.
It looks like since the
RUN
command is already sourcing the.env
file, it's not necessary to include it in thedocker-compose
file. This leaves us without any way to supply runtime variables, but I don't imagine I'll be adding any runtime environment variables soon.The end result is that
docker-compose
runs without any error if no.env
file is present, so there's no need for any scripts to autocreate a.env
file.Btw I've added a GitHub action to
docker-compose build
so we catch any future regressions. This action could potentially be expanded to publish to dockerhub.