zylwin/laravel-installer

By zylwin

Updated 6 days ago

Laravel Installer Docker Image

Image
Languages & frameworks
Developer tools
Web servers
0

1.2K

zylwin/laravel-installer repository overview

Laravel Installer Docker Image

Docker Build Docker Pulls

This repository contains Docker image for the Laravel Installer, providing a convenient way to create Laravel projects for those who use docker as their development environment.

Usage

Pull the Docker Image

To pull the Docker image from Docker Hub, run:

docker pull zylwin/laravel-installer:latest

Create a docker volume for composer cache

docker volume create composer_cache

To create a new Laravel project, run:

docker run -it --rm -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer new myapp
Configuring a Shell Alias

You may wish to configure a shell alias to execute commands more easily:

alias laravel='docker run -it --rm -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer'

To make sure this is always available, add this to your shell configuration file in your home directory, such as ~/.zshrc or ~/.bashrc, and then restart your shell.

> echo 'alias laravel="docker run -it --rm -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer"' >> ~/.zshrc

> echo 'alias php="laravel php"' >> ~/.zshrc

> source ~/.zshrc

> laravel new

Now you can use laravel command to create a new Laravel project and artisan commands will be available as php artisan to create models, migrations, controllers etc. Happy Coding!

Using with Laravel Sail

Laravel Sail comes pre-installed as a dev dependency in new Laravel projects. Run sail:install to publish the compose.yaml and configure your Docker services:

cd myapp

# Publish compose.yaml and configure your Docker services
php artisan sail:install

# Start the development environment
./vendor/bin/sail up
Build the Docker Image

Alternatively, If they want to update anything in the Dockerfile, you can clone this repository and build the image locally using:

git clone https://github.com/zawyelwin/laravel-installer-docker.git

cd laravel-installer-docker

docker buildx build --platform linux/amd64,linux/arm64 --build-arg INSTALLER_VERSION=$INSTALLER_VERSION -t <your-dockerhub-username>/laravel-installer .

License

This project is licensed under the MIT license.

Contributing

Contributions are welcome! If you have any improvements or bug fixes, please feel free to open an issue or submit a pull request.

Acknowledgements

Tag summary

Content type

Image

Digest

sha256:00379d9fe

Size

73.5 MB

Last updated

6 days ago

docker pull zylwin/laravel-installer