Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nexusstar/cf3ce64a2214db7582ea49bfce1d7799 to your computer and use it in GitHub Desktop.
Save nexusstar/cf3ce64a2214db7582ea49bfce1d7799 to your computer and use it in GitHub Desktop.
Running PostgreSQL via Docker
### This gist is a part of the NestJS Zero to Hero course on Udemy.
### https://www.udemy.com/course/nestjs-zero-to-hero/?referralCode=F672C0C701844DC91F4D
To run PostgreSQL on Docker, run the following in your Terminal:
docker run --name postgres-nest -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
@nexusstar
Copy link
Author

i tried running this but the container exits as soon as it starts
Error: Database is uninitialized and superuser password is not specified.

You must specify POSTGRES_PASSWORD to a non-empty value for the

superuser. For example, "-e POSTGRES_PASSWORD=password" on "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":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment