Coder Social home page Coder Social logo

laravel-microservices's Introduction

Laravel Microservices

A simple laravel microservices demo project.

This project consists of three web services user, product & order and one API gateway api-gateway.

The webservices are containerised with Docker and are accessible within a Traefik proxy interface.

traefik image is used for the proxy container and php:7.1-apache is used and extended for the web services containers & the API gateway

The api is using the Guzzle API Client in order to maintain connection with the web services.

Set up

Create a docker-machine *

    docker-machine create laravel-microservices
    eval $(docker-machine env laravel-microservices)

Build

    docker-compose -f docker/docker-compose.yml up -d --build

Teardown

    docker-compose -f docker/docker-compose.yml down --volumes --remove-orphans

Create the external network

    docker network create traefik_webgateway

Update the your hosts

    # Get the ip of the VMachine
    docker-machine ip laravel-microservices
    
    # Update /etc/hosts file
    192.168.99.100 lm.dev user.lm.dev inventory.lm.dev order.lm.dev api.lm.dev

Scale

    # DEPRECATED
    docker-compose -f docker/docker-compose.yml scale ${container-name}

Access

You can access the applications from:

    #user
    user.lm.dev
    
    #inventory
    inventory.lm.dev
    
    #order
    order.lm.dev
    
    #api gateway
    api.dev

You can access Traefik interface from:

    lm.dev:8080

Isolate Web Services

Removing the traefik.frontend.rule from the Web services will make them accesible only from the API gateway (traefik backend network)

laravel-microservices's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.