git clone https://github.com/xaghoul/car-department.git
- Enter in terminal
docker build -f Dockerfile .
from the project root directory. - Then to up containers enter
docker-compose up
- Enter
docker exec -it car_department bash
to connect to thecar_department
container - Enter
psql -U admin -d car_department_database
to connect to database - At this point you can do anything in the database. For example:
\dt
to show all tablesSELECT * FROM car;
to show all table records, or any other sql query. To make it work, tables actually should be created.
docker-compose down -v
to remove containers. V flag actually matter, because without it database won't be removed and with the next creating container the same database will be used
Tech. stack:
- Java 17
- Spring Boot 2.5
- PostgreSQL
- Docker
- Liquibase
- Swagger
- Mapstruct
- Test stack: JUnit 5, Mockito, Testcontainers