Docker

Publishing and running a microservice devprime in Docker

Microservices developed with DevPrime can be contiguized by creating a local or private docker image in ‘Docker Hub’, ‘Azure ACR’, Amazon ECR, Google Container Registry, and other private options.

To use Docker, use the quick guide with several configuration options that we use in the documentation.

Building a docker image
Projects created with DevPrime already bring a ‘Dockerfile’ file configured to build a container using a standard Linux image provided by Microsoft. Run the command in the project folder. You can change the name ‘order’ and the tag ‘v1’.

docker build . -t  order:v1

Publishing a devprime container on dockerhub
Docker uses TAG to organize container images. In our scenario we will inform the address of our repository ‘devprime’ and then we will make a Push.

docker tag order:v1 devprime/order:v1
docker push devprime/order:v1

Exporting parameters to run on Docker
DevPrime CLI provides a command to export the required parameters with DevPrime environment variables for configuration settings. You will have a powershell file and another bash.
dp export docker

Docker Microservices devprime

For easy viewing the parameters were placed on separate lines. When copying the code, update the credentials and remove the line breaks.

docker run --network devprime --name order
-e devprime_app="license=Put your license code|||debug=false|||debugstate=false|||debugstream=false|||debugweb=false|||showenviromentvariables=false|||tenancy=[enable=false,type=Shared,cache=State2,gateway=https://localhost:5003]"
-e devprime_observability="enable=true|||saveinfile=false|||hidedetails=false|||hidedatetime=false|||showhttperrors=400"
-e devprime_web="url=http://*:8080|||enable=true|||enableswagger=true|||postsuccess=201|||postfailure=500|||getsuccess=200|||getfailure=500|||patchsuccess=200|||patchfailure=500|||putsuccess=200|||putfailure=500|||deletesuccess=200|||deletefailure=500"
-e devprime_security=""
-e devprime_services="enable=true|||retry=3|||circuitbreak=45|||timeout=10|||connections=[clientid=your client id,clientsecret=your client secret,granttype=client_credentials,name=Services1,tokenuri=your token uri]"
-e devprime_state1="alias=State1|||dbtype=mysql|||connection=Persist Security Info=False;database=order-mysql;server=mysql;Connect Timeout=30;user id=root; pwd=LltF8Nx*yo|||timeout=5|||dbversion=8.0.26-mysql|||retry=2|||durationofbreak=45"
-e devprime_stream1="alias=Stream1|||enable=true|||default=true|||streamtype=RabbitMQ|||hostname=rabbitmq|||user=guest|||password=guest|||port=5672|||exchange=devprime|||exchangetype=direct|||retry=3|||fallback=State1"
-e devprime_custom="stream.orderevents=orderevents" -e ASPNETCORE_URLS='http://*:8080' -p 8080:8080 order:v1
Last modified March 10, 2022 (615ec2b)