generated from theradcoza/Laravel-Docker-Dev-Template
2.0 KiB
2.0 KiB
Bhoza Shift Manager - Docker Setup
This guide explains how to set up and run the Bhoza Shift Manager app using Docker.
Prerequisites
- Docker Desktop installed
- Docker Compose (usually included with Docker Desktop)
Quick Start
-
Clone the repository:
git clone <your-repo-url> cd bhoza-shift-manager -
Copy the example environment file:
cp src/.env.example src/.env # Or manually create src/.env based on src/.env.example -
Start the app with MariaDB:
docker-compose --profile mysql up -dThis will start the app, Nginx, MariaDB, Redis, and Mailpit containers.
-
Install Composer dependencies:
docker-compose exec app composer install -
Generate the application key:
docker-compose exec app php artisan key:generate -
Run database migrations and seeders:
docker-compose exec app php artisan migrate --seed -
Access the app:
- Web: http://localhost:8080
- Admin: http://localhost:8080/admin/login
- Mailpit: http://localhost:8025
Useful Commands
- Stop all containers:
docker-compose down - Rebuild containers after changes:
docker-compose build --no-cache - Run tests:
docker-compose exec app php artisan test # or docker-compose exec app vendor/bin/pest
Troubleshooting
- If you get a database connection error, ensure MariaDB is running and your
.envhasDB_HOST=mysqlandDB_PORT=3306. - If port 3306 is in use, the container maps MariaDB to another port (e.g., 3308). In that case, only host access changes; containers always use
3306internally. - For other issues, check logs:
docker-compose logs --tail=100
For more details, see the docker-compose.yml and src/.env.example files.