- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/CWSPS154/docker-laravel.git cd docker-laravel cp compose/.env.example compose/.env #and make your changes
- Run the setup script:
chmod +x setup.sh ./setup.sh chmod +x bin/*
- Access the application:
- Laravel App:
http://${DOMAIN}:${WEB_PORT}
- Laravel App:
- Start the containers:
./bin/start
- Stop the containers:
./bin/stop
- Run Laravel Artisan commands: using
./bin/cli
./bin/cli migrate
- Some other commands
./bin/composer #for installing composer packages
./bin/bash #for accessing docker app bash
./bin/restart #restart containers
./bin/rollback #if anything goes wrong you can rollback everything
./bin/status #to check container status
-
Ensure that the storage and cache directories have the correct permissions:
./bin/cli sh -c "chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache && chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache"
-
Verify that the database credentials in the .env file match the settings in compose/docker-compose.yml.
-
sudo usermod -aG docker $USER newgrp docker