Skip to content
Leonardo Espinosa Torres edited this page Apr 22, 2018 · 1 revision

Production Deploy

Execute following steps to prepare comeygana project in Production Environment:

References: https://cloud.google.com/container-engine/docs/tutorials/hello-app

  • Create NodeJs project from meteor project
meteor build ../../deploy-prdcyg/ --directory --server-only --architecture os.linux.x86_64
  • Export environment variables to deploy
export MONGO_URL="mongodb://leonardoespinosa: [email protected]:27017,tstiurest-shard-00-01-pgydc.gcp.mongodb.net:27017,tstiurest-shard-00-02-pgydc.gcp.mongodb.net:27017/test?ssl=true&replicaSet=tstiurest-shard-0&authSource=admin"
export ROOT_URL="http://localhost"
export MAIL_URL="smtp://postmaster%40sandbox95e176686a5c4d7a9e057c9b830aa52b.mailgun.org:[email protected]:587"
export PORT="8080"

The next steps allow create Docker Container and push in GCloud

  • Build docker image
docker build -t prdcyg .
  • list docker images
docker images
  • Test docker image
docker run -p 8080:8080 prdcyg
  • Create Tag to docker image (Specific version)
docker tag prdcyg gcr.io/comeygana-201900/prdcyg:<v0.0.0>
docker tag prdcyg gcr.io/comeygana-201900/prdcyg:v1.0.0
  • Push docker image in GCloud. Execute gcloud init first and docker login!
gcloud docker -- push gcr.io/comeygana-201900/prdcyg:<v0.0.0>
gcloud docker -- push gcr.io/comeygana-201900/prdcyg:v1.0.0
  • Set Zone in GCloud
gcloud config set compute/zone us-east1-d
  • List container clusters
gcloud container clusters list
  • List docker image tags in GCloud
gcloud container images list-tags gcr.io/comeygana-201900/prdcyg
  • Get cluster credentials
gcloud container clusters get-credentials cl-cyg-prd
  • Update Deployment
kubectl set image deployment/prdcyg-node prdcyg-node=gcr.io/comeygana-201900/prdcyg:<v0.0.0>
Clone this wiki locally