Sign inSign up

zackyjack/php-artisan

By zackyjack

•Updated over 9 years ago

A minimal Docker image for Laravel Artisan CLI based on official PHP-Alpine image

Image
2

8.8K

zackyjack/php-artisan repository overview

⁠Quick reference

⁠What is Artisan?

Artisan is the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application.

You can read more about Artisan in Laravel official documentation⁠.

⁠Usage

To view a list of all available Artisan commands, just run the zackyjack/php-artisan image without any additional command:

docker container run --rm --interactive --tty \
    --volume $PWD:/app \
    zackyjack/php-artisan

To serve application with serve command, you need to specify host to 0.0.0.0, so you can open it in your host browser:

docker container run --rm --interactive --tty \
    --publish 80:8000 \
    --volume $PWD:/app \
    zackyjack/php-artisan serve --host 0.0.0.0

And don't change default serve port, if you need to change port, just specify it in --publish flag. E.g. to change port to 8080:

docker container run --rm --interactive --tty \
    --publish 8080:8000 \
    --volume $PWD:/app \
    zackyjack/php-artisan serve --host 0.0.0.0

By default, Artisan runs as root inside the container. This can lead to permission issues on your host filesystem. You can run Artisan as your local user:

docker container run --rm --interactive --tty \
    --volume $PWD:/app \
    --user $(id -u):$(id -g) \
    zackyjack/php-artisan make:migration create_tasks_table

Tag summary

Content type

Image

Digest

Size

27.6 MB

Last updated

over 9 years ago

docker pull zackyjack/php-artisan