Giter VIP home page Giter VIP logo

lumen's Introduction

Docker + Lumen with Nginx and MySQL

image

This setup is great for writing quick apps in PHP using Lumen from an any Docker client. It uses docker-compose to setup the application services.

Clone this repo

git clone https://github.com/saada/docker-lumen.git
cd docker-lumen

Create Lumen App

now, create the app in the images/php directory named app

cd images/php
docker run --rm -it -v $(pwd):/app saada/lumen-cli lumen new app

Configuration

There are two configurations using .env files. One .env file for docker-compose.yaml and another for the php application.

# copy both files and make changes to them if needed
cp .env.docker.example .env
cp .env.app.example images/php/app/.env

To change configuration values, look in the docker-compose.yml file and change the php container's environment variables. These directly correlate to the Lumen environment variables.

Docker Setup

Build & Run

docker-compose up --build -d

Navigate to http://localhost:80 and you should see something like this image

Success! You can now start developing your Lumen app on your host machine and you should see your changes on refresh! Classic PHP development cycle. A good place to start is images/php/app/routes/web.php.

Feel free to configure the default port 80 in docker-compose.yml to whatever you like.

Stop Everything

docker-compose down

Running Artisan commands

docker-compose exec php sh
# inside the container
cd ..
php artisan migrate
php artisan cache:clear

Contribute

Submit a Pull Request!

lumen's People

Contributors

bertrandmarlair avatar

Watchers

 avatar  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.