microkube icon indicating copy to clipboard operation
microkube copied to clipboard

Changing front end microservice

Open umaimehm opened this issue 5 years ago • 3 comments

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.

umaimehm avatar Mar 24 '19 20:03 umaimehm

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

ghost avatar May 02 '19 19:05 ghost

@atbmatt Thank you for the detailed help. Much appreciated.

umaimehm avatar May 14 '19 08:05 umaimehm

No problem @umaimehm . Let me know if you have any troubles!

msembinelli avatar May 15 '19 14:05 msembinelli