#How do I run 3 watch commands

56 messages · Page 1 of 1 (latest)

bitter arrow
#

I'm using templ go and air and tailwind and I don't know how to run 3 watches in parallel

vestal nacelle
#

make new terminal

bitter arrow
#

in docker

vestal nacelle
bitter arrow
vestal nacelle
#

Why do you need to run those in parallel lol

#

like in docker

bitter arrow
vestal nacelle
#

The watch commands are for development

bitter arrow
#

I want to develop

vestal nacelle
#

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

bitter arrow
vestal nacelle
bitter arrow
vestal nacelle
#

No you should just stop the app container

bitter arrow
#

the one that uses postgres and other that is ready for production

vestal nacelle
#

Developing with docker containers is a bad idea because you'll have to rebuild the container after each change lol

bitter arrow
vestal nacelle
#

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

bitter arrow
#

Once in production

#

Because my server will run in docker eventually

vestal nacelle
#

huh

bitter arrow
vestal nacelle
#

I have no idea what your issue is lol

bitter arrow
#

In my Go code

vestal nacelle
#

So please use an env var for the host?

#

what

bitter arrow
# vestal nacelle So please use an env var for the host?
  
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?

vestal nacelle
#

? ? ?

bitter arrow
vestal nacelle
#

ask chat gippity

bitter arrow
#

all I want is connect to the db

#

without localhost

vestal nacelle
#

WHY DOES IT MATTER WHAT YOU USE IN DEVELOPMENT JUST PUT IT IN AN ENVIRONMENT VARIABLE

bitter arrow
vestal nacelle
#

Just put them in an env var ONCE

#

set it up ONCE

#

and it will just work

bitter arrow
#

Oki

jaunty current
#

Lmao

tranquil cove
#

Bro got real mad 💀

#

Erm...I mean... Please be respectful guys 🤓☝️

vestal nacelle