Microservice that keeps a detailed history of all stock trades
If you wish to build locally, setup up your environment variables in your server.env file.
TOPIC="..."
BOOTSTRAP_SERVER="..."
CONSUMER_API_KEY="..."
MONGO_PASSWORD=...
MONGO_USER=...
MONGO_AUTH_DB=...
MONGO_IP=...
MONGO_PORT=...
MONGO_DATABASE=...
If you plan to deploy your application to a cloud environment, you can configure the same properties using Kubernetes Secrets. The bindings.yml links the secrets to the environment variables in the docker container.
Run this from the project directory root:
mvn clean install
To run the project from the target directory:
mvn liberty:run-server
The application should be accessible from http://localhost:9080
Build the docker container from the root directory:
docker build -t trade-history .
To run the docker containter locally:
docker run -p 9080:9080 trade-history
The application should be accessible from http://localhost:9080
Prerequisites:
- Install Cloudctl ClI
- Install Kubectl ClI
Steps:
- Login to your ICP instance using cloudctl from the machine you wish to deploy from.
- Configure your client and set your Kubectl context by copying and pasting the configure client
- Follow the Kubernetes General Deployment Instructions to deploy the application.
After building the docker container locally, use the helm chart from the charts directory to deploy:
helm package chart/tradehistory/ --debug
helm install tradehistory-1.0.0.tgz --name tradehistory-release