Docker compose example, video at 11:40 needs more env parameter to be given to run command

The docker-compose example video when explaining, they have not mentioned about the postgresl env parameter, with out giving it the container exit rather than running

pasting here the results which we get if we dont specify the environment, please check the video and append the changes needed

docker run --name=db postgres:9.4
Error: Database is uninitialized and superuser password is not specified.
You must specify POSTGRES_PASSWORD for the superuser. Use
“-e POSTGRES_PASSWORD=password” to set it in “docker run”.

   You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
   without a password. This is *not* recommended. See PostgreSQL
   documentation about "trust":
   https://www.postgresql.org/docs/current/auth-trust.html

result because of this is the worker-app will not run, pasting the results here as reference

docker run --link redis:redis --link db:db worker-app
docker: Error response from daemon: Cannot link to a non running container: /db AS /amazing_archimedes/db.
ERRO[0000] error waiting for container: context canceled

Try to run the Postgres using the below command:

docker run -d --name=db -e POSTGRES_HOST_AUTH_METHOD=trust postgres:9.4

We use POSTGRES_HOST_AUTH_METHOD=trust to allow passwordless access . but In a real production deployment, don’t use this option. Instead, configure proper credentials using POSTGRES_PASSWORD.

1 Like

It worked, to start the DB
now my feedback is that this video is missing points, after my DB container made up, as per this video done and my result is not displayed
could be better the vedio is cross checked and append the changes
thanks