Sign inSign up

leejoneshane/laravel

By leejoneshane

Updated over 1 year ago

This is a docker image for laravel framework.

Image
Web servers
1

998

leejoneshane/laravel repository overview

laravel

This is a docker image for PHP framework: laravel, it has pre-installed predis/predis(for redis cache), laravel/socialite(OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub and Bitbucket), laravel/passport(to develop OAUTH2 server), guzzlehttp/guzzle(a PHP HTTP client and framework for building web service clients).

The size just 88MB since it build on Alpine.

How to use

This image not include database and redis. You should run mysql first, like below:

docker run -e MYSQL_ROOT_PASSWORD=your.password -e MYSQL_DATABASE=laravel -d mysql

If this is the first container on your computer, then it's ip will be 172.17.0.2.

Then you should run redis secondary, like below:

docker run -d redis

If this is the second container on your computer, then it's ip will be 172.17.0.3.

Now, you can lunch laravel like below:

docker run --name=laravel -p 80:80 -p 443:443 -d leejoneshane/laravel

First time running

You should use Kitematic or use -e parameter in docker command to defind the environment variable list below to tell laravel container how to start:

  • FETCH=no If your mount volume is empty, change to "yes" will fix the problem.
  • INIT=no If you want to initialization your database, set to "yes".
  • MAIL=[email protected] This will be your admin account.
  • WEB_PASSWORD=your.password You need to change it.
  • DB_HOST=172.17.0.2 Link to mysql container.
  • DB_PORT=3306 If you use another port change this, or you can bypass it.
  • DB_DATABASE=laravel If you use another name change this, or you can bypass it.
  • DB_USERNAME=root If you use another account change this, or you can bypass it.
  • DB_PASSWORD=should.match.MYSQL_ROOT_PASSWORD You must change it.
  • REDIS_HOST=172.17.0.3 Link to redis container.
  • REDIS_PORT=6379 If you use another port change this, or you can bypass it.
  • REDIS_PASSWORD=null If you setup password for redis change it, or you can bypass it.
  • CACHE_DRIVER=redis If you don't want to use redis, change it to file.
  • SESSION_DRIVER=redis If you don't want to use redis, change it to file.

Work with SSL

This image can use letsencrypt SSL certificate, but before send request to letsencrypt, you should registered a FQDN and complete DNS configuration. use the environment variable below to tell the container:

DOMAIN=the.site.fqdn

Then you should lunch the container's console, And run the script named gencerts.sh to get SSL certificate::

docker exec -it laravel bash
\#>gencerts.sh

Wait a second you should get your certificate.

Login to admin panel

Use browser to connect the url below, login whith your MAIL/WEB_PASSWORD to management your site.

http://the.site.fqdn/admin

Tag summary

Content type

Image

Digest

sha256:dc9db5951

Size

653.2 MB

Last updated

over 1 year ago

docker pull leejoneshane/laravel