Here, I memo scripts that I have used during development.
docker run --name ndb -p 5432:5432 -e POSTGRES_PASSWORD=pass -d postgres
This cmdlet will create Postgres instance so that you can connect to a database with:
- database: postgres
- username: postgres
- password: pass
- post: 5432
docker exec -i -t ndb bash
Then you will see the containers bash as a root user.
psql -d postgres -U postgres
\l
\dt
\q
spring.datasource.username=postgres
spring.datasource.password=pass
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver