diff --git a/README.md b/README.md index 7ce09fd8e36c95451ae901560e91ab9cba71aba8..99c8cdd9281ea460465c8d5d713da9d3852fd18f 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,20 @@ the car. ## Project structure -Project contains following modules as microservices: +Project contains following modules as microservices. -### common_library +This README contains commands to run individual components as well as commands +to create Docker images. Each image can run on its own, or you can run the whole +app using Docker Compose in project root folder: -`mvn -pl common_library spring-boot:run` +`> docker-compose up` + +## common library Common classes used across the application. -### car +## car `mvn -pl car spring-boot:run` @@ -54,23 +58,50 @@ with the same name as the given component of the car that is not used by the car WARNING: when putting components or drivers, services component and driver need to run. -### component +##### Run component using Docker: +Create the image: + +`> docker build --no-cache -t pa165-formula-one-team-car` + +Run the image: + +`> docker run -p 8082:8082 pa165-formula-one-team-car` + +## component `mvn -pl component spring-boot:run` Management of components. Runs on port 8084. +#### Run component using Docker: +Create the image: + +`> docker build --no-cache -t pa165-formula-one-team-component` + +Run the image: + +`> docker run -p 8084:8084 pa165-formula-one-team-component` + -### driver +## driver `mvn -pl driver spring-boot:run` Management of drivers. Runs on port 8083. +#### Run component using Docker: +Create the image: -### race +`> docker build --no-cache -t pa165-formula-one-team-driver` + +Run the image: + +`> docker run -p 8083:8083 pa165-formula-one-team-driver` + + +## race `mvn -pl race spring-boot:run` @@ -85,6 +116,15 @@ Corresponding services need to run when also assigning drivers or cars in other Runs on port 8081. +#### Run component using Docker: +Create the image: + +`> docker build --no-cache -t pa165-formula-one-team-race` + +Run the image: + +`> docker run -p 8081:8081 pa165-formula-one-team-race` + ## Diagrams ### Use case diff --git a/car/src/main/resources/application.yml b/car/src/main/resources/application.yml index ba623071ddea2a66a0d914a895254e2329e88ac5..59898f13ffad3bc8540b4c638fb80d022e48858d 100644 --- a/car/src/main/resources/application.yml +++ b/car/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: hibernate: ddl-auto: update datasource: - url: jdbc:h2:file:./src/main/resources/data/car;MODE=PostgreSQL + url: jdbc:h2:file:./car/src/main/resources/data/car;MODE=PostgreSQL driverClassName: org.h2.Driver username: admin password: admin diff --git a/component/src/main/resources/application.yml b/component/src/main/resources/application.yml index 891c0868438f2197b55ce46aad03d5496063e147..64e15531da4b38f91456247338fc72d43feae5d1 100644 --- a/component/src/main/resources/application.yml +++ b/component/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: hibernate: ddl-auto: update datasource: - url: jdbc:h2:file:./src/main/resources/data/component;MODE=PostgreSQL + url: jdbc:h2:file:./component/src/main/resources/data/component;MODE=PostgreSQL driverClassName: org.h2.Driver username: admin password: admin \ No newline at end of file diff --git a/driver/src/main/resources/application.yml b/driver/src/main/resources/application.yml index be3e758c9a91731bf108245defd9a03f688d90b0..0611d232a4a009d1c8ed9732be8b6ed197654062 100644 --- a/driver/src/main/resources/application.yml +++ b/driver/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: hibernate: ddl-auto: update datasource: - url: jdbc:h2:file:./src/main/resources/data/driver;MODE=PostgreSQL + url: jdbc:h2:file:./driver/src/main/resources/data/driver;MODE=PostgreSQL driverClassName: org.h2.Driver username: admin password: admin diff --git a/race/src/main/resources/application.yml b/race/src/main/resources/application.yml index 2975b2a44e930efee47194640a8d30cf3712417d..89968757278999d3d726f515b1d991576cf4fc26 100644 --- a/race/src/main/resources/application.yml +++ b/race/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: hibernate: ddl-auto: update datasource: - url: jdbc:h2:file:./src/main/resources/data/race;MODE=PostgreSQL + url: jdbc:h2:file:./race/src/main/resources/data/race;MODE=PostgreSQL driverClassName: org.h2.Driver username: admin password: admin