Sign inSign up

tombenevides/laravel

By tombenevides

•Updated almost 3 years ago

A custom image to run laravel applications.

Image
0

1.2K

tombenevides/laravel repository overview

⁠Quick Reference

⁠Maintained by Tom Benevides:
  • latest
  • php-8.2
  • php-8.1
  • php-8.0
  • php-7.4
  • php-7.3

⁠About the image

This image is set to run a specific kind of PHP projects: Laravel applications. It includes Xdebug and Supervisor to facilitate usage. It's not an optimized image in terms of size because the intent is to development environment. Since Xdebug and Supervisor configurations depends on the project. I DO NOT recommend the use of this image in production.

⁠How to use this image

⁠Add as a docker compose service:
version: '3'
services:
    app:
        image: tombenevides/laravel:php-8.2
        ports:
            - '80:80'
        volumes:
            - '.:/var/www/html'
⁠Environment Variables

There are some environment variables that can be set to customize the usage.

version: '3'
services:
    laravel.test:
        image: tombenevides/laravel:php-8.2
        ports:
            - '80:80'
        environment:
            SUPERVISOR_SERVICES: 'scheduler,queue'
            USER_ID: '1000'
            USER_NAME: 'tom'
            XDEBUG_MODE: 'debug'
            XDEBUG_IDE_KEY: 'VSCODE'
            XDEBUG_CLIENT_HOST: 'localhost'
        volumes:
            - '.:/var/www/html'
  • SUPERVISOR_SERVICES: defines which services will be running when the container goes up. The available values are scheduler, queue and/or horizon separated by comma. These values ​​run Task Scheduler⁠, Queues⁠, and Horizon⁠ respectively. Since these services need a running command, this option is useful for handling these features. It's not mandatory and if it's not defined, Supervisor will run only the artisan serve command to up the project.

  • USER_ID: The ID of the user in the container. You can change depends on your host ID user. It's not mandatory and if it's not defined, the default the value will be 1001.

  • USER_NAME: The name of the user in the container. It's not mandatory and if it's not defined, the default the value will be ubuntu. If you're using a laravel Sail script (or variants), set the value as sail.

  • XDEBUG_MODE: The usage mode of the Xdebug tool. It's not mandatory and if it's not defined, the default the value will be off. You can set other values as debug, develop and/or coverage, separated by comma.

  • XDEBUG_IDE_KEY: The IDE which will receive the steps from Xdebug. You can choose between the tested options, VSCODE and PHPSTORM. Other options can be set but it was not tested. It's not mandatory and if it's not defined, the option will not be set.

  • XDEBUG_CLIENT_HOST: The host used with Xdebug. It's not mandatory and if it's not defined, the default the value will be localhost. If you want to use host.docker.internal, you need to add this to your docker compose service:

laravel.test:
        [...]
        extra_hosts:
            - 'host.docker.internal:host-gateway'
⁠Available extensions:

bcmath, Core, ctype, curl, date, dom, fileinfo, filter, ftp, gd, hash, iconv, igbinary, imap, json, libxml, mbstring, memcached, msgpack, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline, redis, Reflection, session, SimpleXML, soap, sodium, SPL, sqlite3, standard, tokenizer, xdebug, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib

⁠Add more extensions:
FROM tombenevides/laravel:php-8.2

RUN install-php-extensions pdo_mysql

⁠License

View license information⁠ for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Tag summary

Content type

Image

Digest

sha256:95f81a299…

Size

255.1 MB

Last updated

almost 4 years ago

docker pull tombenevides/laravel