- A psql console connection to the database can be opened as follows:
flyctl postgres connect -a blog-app-db
- Creates new container from postgres image with name blog-postgres:
docker run --name blog-postgres -e POSTGRES_PASSWORD=passwordishere -p 5432:5432 postgres
- psql console connection to the database:
docker exec -it blog-postgres psql -U postgres postgres
- local connection to the database enabled:
flyctl proxy 5432 -a blog-app-db
- flyctl proxy 5432 -a blog-app-db
- npm start
- flyctl postgres connect -a blog-app-db