Compose for Laravel is a package that simplifies running and deploying Laravel applications using Docker Compose. It supports macOS, Linux, and Windows (WSL2). This package leverages Docker Compose for container orchestration and Traefik for routing HTTP requests.
To install Compose for Laravel, include it in your Laravel application's composer.json
file:
composer require --dev braceyourself/compose
Upon installation, the compose
script will be available in vendor/bin
.
Run the install command to set up node_modules and composer dependencies.
./vendor/bin/compose install
compose COMMAND [options] [arguments]
- compose install: Uses docker containers to install composer and npm dependencies
- compose build: Build the Docker containers
- compose start: Start the application (docker-compose up -d)
- compose deploy: Deploy the application to a remote server
After running compose for the first time, the docker-compose file will be published to your project root.
Ensure you have a .env
file in your project root. The script will source this file to set up the necessary environment variables.
When running the deploy
command, the remote .env
file will be created based on your .env.example
file
If you encounter issues, ensure your system meets the requirements and that Docker and Docker Compose are properly installed and configured.
Please report any issues.