-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support bun-like .env hierarchy in docker compose #40
Conversation
I feel like we should put the webservice into a container too. Also, is there a way to specify the switches in the bun:db command? E.g. I would generally dislike using -d, but others tend to prefer it Regarding the .env file hierarchy, I don't think it's particularly needed. You'd only use docker compose locally, I don't think there are cases where you'd switch envs like that during development. Nevertheless, they are super useful during deployments |
Accidentally closed it... |
Sure, 100%, I opened an issue for this in #41. |
Yes Edit: sorry, tested this on a branch without the |
Right now I can't spin up the db server because I have another connection running on port 5432 (the work one). I have to close it in order to develop this project and go back and forth. Sure, I can simply change the POSTGRES_PORT in IMO, the simplest solution is to add support for a |
this allows the usage of `bun db:up -d`
Makes sense 🙌 |
The Bun .env hierarchy supports defining
.env.local
files to take precedence over the.env
file in order to locally customize environment variables.In our use case, this is useful for defining a different POSTGRES_PORT in case 5432 is already used by another connection.
This way, we can keep
.env
source controlled for example purposes and allow people to customize it by duplicating the file, renaming to.env.local
and assigning different values. The resulted file will not be in source control.This PR adds the same level of support to
docker-compose
which doesn't officially support .env hierarchy.Now you just need to run
bun db:up
and it will spin up the Postgres docker container with.env
as a default or with.env.local
if you have one instead.