#Monolitic Server for jasu-server
###Development
Run development container with: (for any other mode just edit the NODE_ENV variable)
docker run --name jasu-server -e NODE_ENV=development -p 4000:4000 --rm -it jasu-server
###Deployment
- build the image:
docker build -t jasu-server .
- run the image in demon mode:
docker run -d --name jasu-server -p 4000:4000 --rm -it jasu-server
- get the container id:
docker container ls
- commit the container: (change the version as it grows)
docker container commit jasu-server jasu-server:v1.1.0
- tag the container:
docker image tag jasu-server:v1.1.0 registry.digitalocean.com/bluepixel/jasu-server:v1.1.0
- push the container to the registry:
docker image push registry.digitalocean.com/bluepixel/jasu-server:v1.1.0
- create the deploy:
(get the image sha from digitalocean registry)kubectl create deployment jasu-server --image=<YOUR_IMAGE_SHA> --dry-run=client -o yaml > deploy.yaml
- deploy:
kubectl apply -f deploy.yaml
- expose a service to externally access to the application:
(the port should be the containerPort)kubectl expose deployment/jasu-server --type="NodePort" --port 4000
###Auxiliary documentation
- https://www.digitalocean.com/community/tech_talks/how-to-deploy-your-application-or-microservice-as-a-kubernetes-deployment
- https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-kubernetes
- https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
- (for docker-compose apps) https://kubernetes.io/docs/tasks/configure-pod-container/translate-compose-kubernetes/
docker run -d --network bluepixel --name sandbox -p 3000:3000 --rm -it jasu-server