microkube
microkube copied to clipboard
Changing front end microservice
How can we change the front end micro service ? Config/app.yml mentions two instances of frontend :
vendor:
frontend: https://github.com/rubykube/mikroapp.git
images:
frontend: rubykube/mikroapp:0.1.5
I understand the GitHub setting but not sure how to go about the docker cloud image. Do we need to update both variables ?
Thanks.
When I first did this, I was having issues with the port on the newly built vendor frontend container not being properly exposed. When I issued docker ps
there was no port mapped.
So what I did was update my vendor.yaml.erb
template to add expose
:
version: '3.6'
services:
frontend:
image: node:11
user: "${UID}:${GID}"
volumes:
- ../vendor/frontend:/home/node
command:
- sh
- -c
- |
cd /home/node
yarn
yarn start
expose:
- '3000'
labels:
traefik.enable: true
traefik.frontend.rule: "PathPrefix:/;Host:<%= @config['app']['subdomain'] %>.<%= @config['app']['domain'] %>"
traefik.port: 3000
Then I followed the instructions as normal.
Fork mikroapp, then link the github fork in the vendor section of app.yml
vendor:
frontend: https://github.com/umaimehm/mikroapp.git
Following the README
Render compose file
rm compose/vendor.yaml
rake render:config
Review the generated file
Clone the vendors and start
source ./bin/set-env.sh
rake vendor:clone
docker-compose -f compose/vendor.yaml up -d
@atbmatt Thank you for the detailed help. Much appreciated.
No problem @umaimehm . Let me know if you have any troubles!