Java JDK
docker
docker-compose
config.json
{
"resourcesPath": "src/main/resources",
"database": {
"driver": "org.postgresql.Driver",
"url": "jdbc:postgresql://172.18.0.2:5432/maindb",
"username": "admin",
"password": "admin",
"maximumPoolSize": 2,
"connectionTimeout": 30000
},
"security": {
"encryptionSecret": "super-super-secret",
"jwtSecret": "dghdvtg23fgJNJJUedffcc..",
"jwtExpirationMinutes": 240
}
}
- Open Oracle VM VirtualBox Manager
- Right-click on proper VM instance
- Settings
- Network
-
Card 1: NAT network Ports forwarding NAZWA | PROTOKÓŁ | IP HOSTA | PORT HOSTA | IP GOŚCIA | PORT GOŚCIA --------------------------------------------------------------------------------- * pgndb-backend | TCP | | 9095 | | 9095 * pgndb-database | TCP | | 5432 | | 5432 * pgndb-frontend | TCP | | 4200 | | 4200 * ssh | TCP | 127.0.0.1 | 50678 | | 22 Card 2: (host-only) network
-
Start VM for docker
docker-machine start default
-
Configuring shell might be needed (example for machine name: "default")
@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
docker-compose up --build -d
docker-compose down
docker-compose up --build -d
docker-compose down
Configuration of config.json
Windows:
"url":"jdbc:postgresql://localhost:5432/maindb"
Linux:
"url": "jdbc:postgresql://172.18.0.2:5432/maindb"
Starting backend from Intellij IDEA requires following database start/stop:
docker network create --subnet=172.18.0.0/16 backend
docker build -t pgndb-database:1.0.0 .
docker run --rm -d --net=backend --ip 172.18.0.2 -p 5432:5432 --name pgndb-database pgndb-database:1.0.0
On Windows turning off port forwarding for backend port might be needed.
Starting frontend from Intellij IDEA requires following steps:
npm install
ng serve
cd deployment
docker build -t pgndb-frontend:1.0.0 .
docker run --rm --net=backend --ip 172.18.0.4 -p 4200:4200 --name pgndb-frontend pgndb-frontend:1.0.0
Accessing backend/database container shell:
docker exec -it pgndb-backend bash
docker exec -it pgndb-database bash
docker exec -it pgndb-frontend bash
Accessing real time logging for backend/database:
docker logs -f pgndb-backend
docker logs -f pgndb-database
docker logs -f pgndb-frontend
Cleanup:
docker rm -f pgndb-database
docker network rm backend
docker volume rm pgndb_pgndb-data
git push origin master:release/1.0.0
git checkout release/1.0.0
gradlew bootJar
cd webclient
npm install
ng build --prod --output-path=../deployment/dist
mkdir ..\deployment\dist\src
xcopy src\chessboardjs ..\deployment\dist\src\chessboardjs\ /e
cd ..
git push origin master:release/1.0.0
git checkout release/1.0.0
./gradlew bootJar
cd webclient
npm install
ng build --prod --output-path=../deployment/dist
mkdir -p ../deployment/dist/src
cp -R src/chessboardjs ../deployment/dist/src
cd ..