Cosmin Potocean
DevNexus, March 2019
Extending microservice honeycomb to front-end applications
|
|
`
https://hub.docker.com/
docker --version 5.33G 07:22 03.08.19 100%
Docker version 18.09.2, build 6247962
FROM nginx:1.15
MAINTAINER cosmycx
COPY build /usr/share/nginx/html
EXPOSE 80
# build stage
FROM node:latest as builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
# create image stage
FROM nginx:latest
MAINTAINER cosmycx
COPY --from=builder app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
RUN chmod 777 -R /usr/share/nginx/html
EXPOSE 80
https://www.cncf.io/
Cloud Native Landscape
<template>
<li class="list-group-item">
{{ person }}
</li>
</template>
<script>
export default {
name: 'PersonListItem',
props: {
person: Object
}
}
</script>
<style>
</style>
Roll your own solution
https://github.com/cosmycx/react-app-sync
rsync = spawn( 'rsync', [ '-avu', extPath, intPath] )
Use bitsrc (?) https://bitsrc.io/
10 Things I Regret About Node.js - Ryan Dahl - JSConf EU 2018, https://www.youtube.com/watch?v=M3BM9TB-8yA&vl=en
version: '3'
services:
traefik:
image: traefik:latest
command: --web --docker --docker.domain=localhost.local --logLevel=DEBUG
networks:
- microapps1
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
homeapp:
image: microapps/homeapp
labels:
- "traefik.frontend.rule=Host:localhost"
build:
context: ./homeapp/
dockerfile: Dockerfile
restart: always
container_name: homeapp
networks:
- microapps1
reactapp1:
image: microapps/reactapp1
labels:
- "traefik.frontend.rule=Host:localhost; PathPrefixStrip: /reactapp1"
build:
context: ./reactapp1/
dockerfile: Dockerfile
restart: always
container_name: reactapp1
networks:
- microapps1
reactapp2:
image: microapps/reactapp2
labels:
- "traefik.frontend.rule=Host:localhost; PathPrefixStrip: /reactapp2"
build:
context: ./reactapp2/
dockerfile: Dockerfile
restart: always
container_name: reactapp2
networks:
- microapps1
vueapp:
image: microapps/vueapp
labels:
- "traefik.frontend.rule=Host:localhost; PathPrefixStrip: /vueapp"
build:
context: ./vueapp/
dockerfile: Dockerfile
restart: always
container_name: vueapp
networks:
- microapps1
networks:
microapps1:
driver: bridge
https://github.com/cosmycx/micro-web-apps
https://slides.com/cosminp/micro-front-ends/
Slides:
Code:
https://github.com/cosmycx/micro-web-apps
Thank you!