#How do I run 3 watch commands
56 messages · Page 1 of 1 (latest)
make new terminal
So I should add bun to my docker and then run it in parallel that I been using in my package.json file
I don't
The watch commands are for development
Yes
So you start your terminal
you go docker compose up for just the database
then you make another window / pane / whatever in your terminal for the npm run templ and another for the npm run tailwind and another for the npm run air and then you write your code
I cannot use localhost in the docker file without breaking this
This one shouldn't be used during development
So I should have 2 docker compose files?
No you should just stop the app container
the one that uses postgres and other that is ready for production
Developing with docker containers is a bad idea because you'll have to rebuild the container after each change lol
but then I cannot connect to the db without using localhost
doesn't matter for development
you just take the db host from an env var
in development it's localhost, in the docker-compose it's the db container
But then how do I run my server with my db
Once in production
Because my server will run in docker eventually
huh
You saying that I can expose the Postgres port as db?
I have no idea what your issue is lol
The issue is that in my code where I'm trying to connect to the db I can only use the localhost otherwise when it's in docker I need to change the host to db
In my Go code
db:
image: postgres:latest
container_name: postgrestest
ports:
- "5432:5432"
environment:
POSTGRES_USER: myUser
POSTGRES_PASSWORD: myPassword
POSTGRES_DB: myDatabase
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myUser -d myDatabase"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
volumes:
postgres_data:
so what do I need to do?
? ? ?
I don't know what you mean
ask chat gippity
I already did
all I want is connect to the db
without localhost
WHY DOES IT MATTER WHAT YOU USE IN DEVELOPMENT JUST PUT IT IN AN ENVIRONMENT VARIABLE
So I don't need to change the ports nonstop
Oki
Lmao
ong