The entire solution consists of the 6 micro-services (v1.9.0)
- Key Management.
- Token Management.
- Main (Contains web representation).
- Admin Portal (Contains web representation).
- EcigMedia Portal (Contains web representation).
Required tool to build and deploy solution:
- Java v1.8
- Maven v3.3.9
- NodeJS v8.11.4
- NPM v5.6.0
- Docker v18 and higher
- Docker Compose v1.22.0 and higher
The solution data is stored in the three databases: Key Management, Token Management and Main. So description for these services will include instructions for the DB migration. DB migration is performed using a docker container, – at first, docker image should be built using build.sh then docker container should be started and migration executed using run-daemon.sh script.
- First of all, correspond schema should be created in the DB. Default name may be found in the application configuration file: applcation.properties . Obviously, schema name may be changed for the deployment needs.
- Docker image should be built using sh. A path to the bash file to build docker image for the DB migration: ../provisioning/liquibase/build.sh
- Docker container should be started and migration executed using run-daemon.sh Path to the bash file: ../provisioning/liquibase/run-daemon.sh
All micro-services uses KMS protection of the configuration files. For the application deployment, Docker is used as well.
- Token Management and Main micro-service depend on adbank-schedulerlock It must be built using mvn clean install command in the very beginning to achieve artifact which will be used before mentioned micro-services.
- Before application deployment, file application.properties should be updated with the properties for the corresponding environment. Then config file should be encrypted. For the details, refer to the: documentation\AWS_KMS_configuration.md Then encrypted file may be safely placed on the instance. Path to the folder with encrypted properties file must be set up during container running using -v flag: -v /home/ubuntu/provisioning/main/app/ext-config:/ext-config
- Services with web representation contain in service root folder package.sh which should be executed in the very beginning of the micro-service deployment.
- To build docker image execute: mvn clean install -Pdocker . This command will package prepared web file in the executable jar file.
- Then run docker container using command
runfor the application start. Like:
docker run -d -t -i -p 8080:8080 \ --name adbank-main-service \ --restart always \ -v /home/ubuntu/provisioning/main/app/ext-config:/ext-config \ adbank-main-service:1.0 /opt/startup.sh
Here we configuring:
- Microservice port using p flag -p 8080:8080 ;
- Docker container name: –name adbank-main-service ;
- Path to the volume to mount: -v /home/ubuntu/provisioning/main/app/ext-config:/ext-config – used to mount encrypted configuration file to the instance;
- If needed script which should be executed during the startup:
Docker Compose used for the Revive deployment. Navigate to the: revive-adserver-4.1.3-docker and execute: docker-compose up -d . This will run MySQL DB and the Revive application containers. For more information regarding Revive configuration and plugins installation refer to: revive-adserver-4.1.3-docker/README.md
For the detailed information, refer to: