#docker-compose.dev.yml missing DB_URL

1 messages · Page 1 of 1 (latest)

polar apex
#

File docker-compose.yml is defining the following:
DB_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}

why is that missing in docker-compose.dev.yml ?

Thanks a lot for your support in advance.

Volker

wraith dome
#

Hi @polar apex
The purpose of docker-compose.dev is to run all the "peripheral" services like the database or the kafka broker, etc. but without running the actual generated service itself in a container, since this is for dev purposes and the assumption is that you are running the generated service locally with "npm run start" or even running it in debug mode from your IDE.

On the other hand, the docker-compose (non dev) file runs all the services - meaning that the generated service also runs inside a container.

In the first case (dev), since you are running the service on your local machine, the generated .env file , which contains the DB_UR, is sufficient. There is no need to specify any environment variables for the generated service in the docker file since the generated service will not run inside a container.

In the second case (non-dev), the generated service runs inside the container and it makes sense to inject all the environment variable into the container as part of the docker-compose file.
Note that the DB_URL is defined under the "server: " service in this case (and this "server:" service does not exist in the docker-compose.dev to begin with).

I hope this clarifies things for you. Sorry for the delayed response, and I hope you're enjoying Amplication!

polar apex
#

thanks a lot for the long explanation