Coder Social home page Coder Social logo

fabriziocafolla / lumen-microservice Goto Github PK

View Code? Open in Web Editor NEW
226.0 19.0 46.0 172 KB

Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 8 | Aws ECS, Google Kubernates, Azure Container Engine

Home Page: https://fabriziocafolla.github.io/lumen-microservice

License: GNU General Public License v3.0

Dockerfile 21.91% Makefile 11.84% HTML 35.64% Shell 30.62%
docker-compose docker devops rest-api lumen lumen-api backend-services aws-ecs microservices-architecture api-service php-container docker-image php-micro-framework laravel rest api lumen-microservice php

lumen-microservice's Introduction

Docker infrastructure for Lumen

Microservice Lumen is a starting skeleton based on Docker and Lumen Framework. This project helps to develop and maintain a simple and clean infrastructure for the management / creation of php microservices. In just a few steps, the developer starts the development / staging / production environment as needed. Basically, the Nginx containers are available for the webserver, the backend container in PHP 7.4 for the application, both based on Linux alpine. Include MySQL container by default. The Dockefile (in the docker folder) is already set up to create the production image of the application, we recommend modifying it only to add dependencies or configurations.

Develop env

The first time the setup is run some data will be asked as input (app name, larvel version, and others), this will generate an env.conf file and a .env file (which is the exact copy), the former you will have to version the latter will be excluded. Also, the laravel/lumen source code will be downloaded, it too will need to be versioned. In case your project has already been initialized, whoever is going to download it will still have to perform both the first step indicated in 'setup and run'.

Required

OS: linux
Packages: make
Docker version: >= 18.09.6
docker-compose version: >= 1.28.0

Setup

  1. run make setup

  2. [not required] Set .env db connection into lumen/ dir:

    DB_CONNECTION=mysql
    DB_HOST=mysql.private
    DB_PORT=3306
    DB_DATABASE=lumen
    DB_USERNAME=root
    DB_PASSWORD=root
    
  3. run make build && make up

Make commands

down:  down containers

up:   up -d containers

exec:  enter in app container

exec_mysql:  enter in mysql container

ssh_root:  connection ssh (as root) to server

ssh:  connection ssh (as www-data) to server

deploy: rebuild containers (down, build and up)

image_build:  build immagine

image_push: publish image

image_push: run image

Manual push into docker hub registry

References

Nginx: 1.22

PHP: 8.2-fpm-alpine

MySQL: 8.0

Lumen Framework: delfault master (or specific version)

Mantained by

License

This project is open-sourced software licensed under the MIT license

lumen-microservice's People

Contributors

dependabot[bot] avatar fabriziocafolla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lumen-microservice's Issues

Permission error on Entrypoint script

Hi,

after creating and publishing the image, if you try to start it, the nginx service fails with the following error:
starting container process caused: exec: "/usr/local/sbin/services/init.sh": stat /usr/local/sbin/services/init.sh: permission denied: unknown

The problem is bypassed by editing the following line in the Dockerfile:
USER www-data
to
USER root
at row 86.

Thanks.

Più microservizi

Ciao, sinceramente cosi è poco chiaro con un servizio solo. Se ci sono più microservizi? E forse non tutti in lumen?

Redis-cli container close just after start

Redis-cli container close just after start, logs seems to be empty.
Problem seems to be related to command attribute on docker-compose.

  # Use it with command: docker-compose run redis-cli
  redis-cli:
    container_name: ${NAME}_redis-cli
    image: "${REDIS_NAME}:${REDIS_TAG}"
    links:
      - redis
    command: redis-cli -h redis

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.