An example how to access database from Scala Play application using Slick library.
Run PostgreSQL and pgAdmin containers. There is docker-compose.yml file included
docker-compose up -d
- Open pgAdmin in browser
- Add new server
- Host name/address = postgres_container (name of docker container)
- Port = 5432 (exposed port)
Run Scala Play application. 9000 is default port, you can change it.
sbt "run 9000"
SQL scripts from conf/evolutions folder will be executed when application is started.
Open application index page. It will render swagger documentation.
Enjoy!