saada / docker-lumen Goto Github PK
View Code? Open in Web Editor NEWDocker Compose setup for quickly writing apps with the Lumen Framework
Docker Compose setup for quickly writing apps with the Lumen Framework
Hi, great project!
It would be nice to have xdebug working into the project, and maybe some instructions about mapping and configuration in vscode.
I just updated docker to the latests versions, and somehow it stopped working, I just can't access to it.
Can it be it is related to the Docker version?
Thanks
Hi, my docker is saying:
The Compose file './docker-compose.yml' is invalid because:
php.environment.APP_DEBUG contains true, which is an invalid type, it should be a string, number, or a null
cheers!
Hi, so im using Laravel migrations for the database
how can i run "php artisan migrate" command on dockerfile ?
Thanks.
Hey, getting this error after running
docker-compose up --build -d
and browsing to http://localhost:80/
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/html/app/vendor/symfony/debug/Exception/FlattenException.php on line 41
Fatal error: Exception thrown without a stack frame in Unknown on line 0
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/html/app/vendor/symfony/debug/Exception/FlattenException.php on line 41
Fatal error: Exception thrown without a stack frame in Unknown on line 0
Also tried to change the port (80) but got the same error.
In default install lumen app i have some permission errors when i am trying to save my view files
I fix this by this command:
chmod 777 -R /storage
But i have a new error, nginx/docker/lumen doesn't see my assets files (css/images/js) in public folder
P.S:: routing works perfectly
/images/php/app/app/Http/routes.php
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$app->get('/', function () use ($app) {
return view('index');
});
$app->get('instruction', function () use ($app) {
return view('instruction');
});
$app->get('cart/get', 'CartController@get');
$app->get('newsletter/subscribe', 'NewsletterController@subscribe');
/images/php/app/resources/views/instruction.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="instruction-assets/bootstrap.min.css">
</head>
<body>
<div class="container-test">
<div>
<img src="img/products/bag.jpg">
</div>
</div>
</body>
</html>
instruction-assets/bootstrap.min.css -> 404
img/products/bag.jpg -> 404
I get the following error on docker-compose build. Will start investigating but wanted to post here incase this was familiar.
Step 3 : RUN docker-php-ext-install mcrypt mbstring tokenizer mysql
---> Running in 95be90350e29
error: /usr/src/php/ext/mysql does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mcrypt mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip
Service 'php' failed to build: The command '/bin/sh -c docker-php-ext-install mcrypt mbstring tokenizer mysql' returned a non-zero code: 1
I'm trying to do migration using the following command:
$docker-compose exec <IMAGE_NAME> php artisan migrate
where <IMAGE_NAME>
is php
, but artisan
is not found.
Hi,
It would be nice to have https support with e.g. letsencrypt.
But I'm not quite into the topic to do it all on my own.
I found a docker image that looks like it would be compatible with this one.
Can somebody have a look on it if this might work out:
https://hub.docker.com/r/linuxserver/letsencrypt/
Thanks
Hi, any artisan commands, i.e. php artisan make:migration create_users_table
, produce the following:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Memcached' not found
How do I install soap extension on this image. I have tried everything
I get error below when I run docker-compose up --build -d
Thanks!
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get install -y php5-memcached && docker-php-ext-install mcrypt mbstring tokenizer mysqli pdo_mysql && apt-get install -y libz-dev libmemcached-dev && pecl install memcached && echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini' returned a non-zero code: 100
Hi,
I believe I have followed the Readme to the letter but am getting
in Connector.php line 119
at PDO->__construct('mysql:host=192.168.99.100;port=tcp://172.17.0.3:3306;dbname=lumen', 'lumen', 'secret', array('0', '2', '0', false, false)) in Connector.php line 119
at Connector->createPdoConnection('mysql:host=192.168.99.100;port=tcp://172.17.0.3:3306;dbname=lumen', 'lumen', 'secret', array('0', '2', '0', false, false)) in Connector.php line 56
at Connector->createConnection('mysql:host=192.168.99.100;port=tcp://172.17.0.3:3306;dbname=lumen', array('driver' => 'mysql', 'host' => '192.168.99.100', 'port' => 'tcp://172.17.0.3:3306', 'database' => 'lumen', 'username' => 'lumen', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 24
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => '192.168.99.100', 'port' => 'tcp://172.17.0.3:3306', 'database' => 'lumen', 'username' => 'lumen', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 100
at ConnectionFactory->Illuminate\Database\Connectors{closure}()
at call_user_func(object(Closure)) in Connection.php line 956
at Connection->getPdo() in Connection.php line 824
at Connection->reconnectIfMissingConnection() in Connection.php line 709
at Connection->run('select * from cars
', array(), object(Closure)) in Connection.php line 351
at Connection->select('select * from cars
', array(), true) in Builder.php line 1648
at Builder->runSelect() in Builder.php line 1634
at Builder->get(array('')) in Builder.php line 613
at Builder->getModels(array('')) in Builder.php line 318
at Builder->get(array('*')) in Model.php line 632
at Model::all() in CarsController.php line 10
at CarsController->index()
at call_user_func_array(array(object(CarsController), 'index'), array()) in Container.php line 508
at Container->call(array(object(CarsController), 'index'), array()) in RoutesRequests.php line 610
at Application->callControllerCallable(array(object(CarsController), 'index'), array()) in RoutesRequests.php line 553
at Application->callControllerAction(array(true, array('uses' => 'App\Http\Controllers\CarsController@index'), array())) in RoutesRequests.php line 512
at Application->callActionOnArrayBasedRoute(array(true, array('uses' => 'App\Http\Controllers\CarsController@index'), array())) in RoutesRequests.php line 497
at Application->handleFoundRoute(array(true, array('uses' => 'App\Http\Controllers\CarsController@index'), array())) in RoutesRequests.php line 394
at Application->Laravel\Lumen\Concerns{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Laravel\Lumen\Routing{closure}(object(Request)) in RequestLogMiddleware.php line 14
at RequestLogMiddleware->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Laravel\Lumen\Routing{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in RoutesRequests.php line 647
at Application->sendThroughPipeline(array('App\Http\Middleware\RequestLogMiddleware'), object(Closure)) in RoutesRequests.php line 400
at Application->dispatch(null) in RoutesRequests.php line 341
at Application->run() in index.php line 28
exception when I try and connect and get anything from default database (as set up by the docker-compose command.
I have managed to get this working though by
docker exec -it dockerlumen_php_1 /bin/bash
php-fpm -m doesn't list pdo-mysql (only pdo-sqlite), so the quess is that the docker set up hasn't installed the correct module for mysql & pdo.
running
docker-php-ext-install pdo_mysql within the container gets the correct module installed (verified by php-fpm -m).
Keeping this setting saved though between restarts is the problem.
ctrl + p q to exit exec,
stop php docker container (not docker-compose), then restart it gets my lumen app to work (access the db), but doesn't handle restarts (of docker-compose).
Also, how does my database persist between restarts of docker compose??
Thanks
I am trying to start a project with this package, but the Create Lumen App
step fails:
Unable to find image 'alairock/lumen:latest' locally
docker: Error response from daemon: pull access denied for alairock/lumen, repository does not exist or may require 'docker login'.
See 'docker run --help'.
I thing that the package alairock/lumen
is no longer available
Hey,
I had a problem that browser was giving me text message like : File not found, so had to change paths to: /var/www/html/app/public
. Do you want PR for that?
Did you encounter any performance issue?
I do a basic request and getting the response take 10 sec on average. I don't hit the database or so.
pls let me know, or how I can improve it,
Roy
Same issue as moby/moby#26855.
Solution is changing from
docker-compose.yml
working_dir: /app/public
to
working_dir: /var/www/app/public
volumes:
- ./images/php/app:/app
to
volumes:
- ./images/php/app:/var/www/app
And nginx.conf
root /app/public;
to
root /var/www/app/public;
Hope that helps.
First of all, you're doing great work. These linked containers helped me out a lot, because they allow me to work locally and (in the future) setup continuous integration. I noticed one issue, however.
Maybe it's me working on a Mac (although this should not be an issue when using Docker), but the folder /var/www/html/public
in nginx.conf
does not exist in container php
. As a result, the browser returns 'File not found.' when I browse to localhost:80 (or 8080 in my case), since the nginx container tries to search for a file index.php
in container php
for a folder /var/www/html/public
, which does not exist.
I tried several solutions, and this worked for me: /var/www/app/public
does exist, so I recommend replacing 'html' by 'app'. Otherwise, changing lumen new app
to lumen new html
may be a solution, but I did not test that yet.
From a scratch success build run gets:
Fatal error: Uncaught UnexpectedValueException: The stream or file "/var/www/html/storage/logs/lumen.log" could not be opened: failed to open stream: Permission denied in /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107 Stack trace: #0
And I run
docker-compose exec php ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.9 135220 18816 ? Ss 04:56 0:00 php-fpm: master process (/usr/local/etc/
www-data 5 0.0 0.6 135624 12552 ? S 04:56 0:00 php-fpm: pool www
www-data 6 0.0 0.6 135624 12552 ? S 04:56 0:00 php-fpm: pool www
So php is running ww-data
Then I run
docker-compose exec php ls -la /var/www/html/storage
total 0
drwxr-xr-x 1 1000 staff 102 Jun 22 04:36 .
So the folder is own by staff. Which caused the permission issue
My current solution is
I am having problems with the error message "File not found". I have tried to change the path to: /var/www/html/app/public, /var/www/html/public, /var/www/html, but none of them works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.