Simple golang app get date trivia from http://numbersapi.com using gin-gonic framework. this app using default configuration so thats run on http://0.0.0.0:8080.
this consist only 1 endpoint 0.0.0.0:8080/trivia
Build docker container onli run build.sh with parameter <STATE_ENV> and <tag version>
-
<STATE_ENV>is env of application like production, staging and development or whatever that developer want to sparate the server environment. this parameter will save toos envon docker image. so the backend will read thisos envto sparate the configuration. -
<tag version>is versioning of application example :sh build.sh development v1.0
-
some detail is written on script
build.shandDockerfile
step to change docker image and push to docker registry make some change on build.sh
- change
REGISTRYparameter as your private registry on ex :REGISTRY: "asia.gcp.com/private-registry/" - change
APP_NAMEparameter as your docker image name ex:APP_NAME: "simple_gin"3 uncommand this line:#docker push ${REGISTRY}${APP_NAME}:${REVISION}