• Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    Dockerfile
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker Compose setup for quickly writing apps with the Lumen Framework

Docker + Lumen with Nginx, MySQL, and Memcached

image

Why?

Setting up an entire Lumen stack can be time consuming. This repo is a quick way to write apps in PHP using Lumen from an any Docker client. It uses docker-compose to setup the application services, databases, cache, etc...

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

docker run --rm -it -v $(pwd)/images/php:/app $(docker build -q .) composer create-project --prefer-dist laravel/lumen ./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

Docker for Mac

Docker for Windows

Docker for Linux

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!

More Repositories

1

container-hive

Visualize microservices
JavaScript
42
star
2

docker-compose-php-mysql

PHP environment setup using Docker Compose on OSX
PHP
31
star
3

macOS-dock-spaces

macOS app for adding spaces to your dock to help you organize your apps
Objective-C
22
star
4

Habitica-macOS

Habitica (formerly HabitRPG) native version for the mac desktop
HTML
15
star
5

yii2-factory-muffin

Yii2 wrapper for league/factory-muffin with Gii generators
PHP
14
star
6

sails-angular-yeoman-example

A sample integration of all three technologies (Sails, Yeoman, and Angular).
JavaScript
12
star
7

sails-ember-yeoman-example

A sample integration of all three technologies (Sails, Yeoman, and Ember).
JavaScript
10
star
8

kubectl-pronounciation

How to pronounce kubectl
9
star
9

reactjs-bootstrap

Simple ReactJS components for Bootstrap 3.
JavaScript
7
star
10

mongodb-operator

Kubernetes (k8s) MongoDB operator written in Go with operator-framework.
Go
5
star
11

flowdock-slack-theme

Make Flowdock look more like Slack
CSS
5
star
12

tracing-kafka

Tracing Kafka talk for opening of Distributed Tracing Meeting at Uber Aug 28th 2018
Java
5
star
13

Thoth

JavaScript
4
star
14

Bootstrap-Popover-Generator

Generates a customizable popover for you!
CoffeeScript
3
star
15

Random

Random stuff
Shell
2
star
16

reactjs-snippets

Simple ReactJS snippets
1
star
17

randomstuffs

JavaScript
1
star
18

XMetaL

React-inspired XML/HTML component library for Javascript
JavaScript
1
star
19

openbook

1
star
20

docker-sshfs-proxy

Experiment with streaming files using SSH, SFTP, SSHFS protocols over two ssh hops via proxy simulated in Docker from macOS clients
1
star
21

gitops-cluster-management

Use GitOps to manage kubernetes clusters
Shell
1
star