...
Run a Postgres 13 container instance and create 'cpsdb' database.
Code Block |
---|
sudo docker run -d \
--name postgres-instance \
-e POSTGRES_DB=cpsdb \
-e POSTGRES_USER=cps \
-e POSTGRES_PASSWORD=cps \
postgres:13.0 |
NB. On Linux the IP address of the Docker container (DB_HOST) can be determined using following command
('postgres-instance' is a container name)
Code Block | ||
---|---|---|
| ||
sudo docker inspect postgres-instance | grep IPAddressCREATE USER cps WITH PASSWORD 'cps'; CREATE DATABASE cpsdb OWNER cps; |
Setup schema in DB
The spring-boot application auto creates the schema on startup via a script run by JPA.
...
From the features\cps\ folder run the following command :
Code Block |
---|
java -DDB_HOST=localhost -DDB_USERNAME=cps -DDB_PASSWORD=cps -jar cps-rest/target/cps-rest-0.0.1-SNAPSHOT.jar
|
OR
From the features\cps\cps-rest folder run the following command :
...