# Bhoza Shift Manager - Docker Setup This guide explains how to set up and run the Bhoza Shift Manager app using Docker. ## Prerequisites - [Docker Desktop](https://www.docker.com/products/docker-desktop) installed - [Docker Compose](https://docs.docker.com/compose/) (usually included with Docker Desktop) ## Quick Start 1. **Clone the repository:** ```sh git clone cd bhoza-shift-manager ``` 2. **Copy the example environment file:** ```sh cp src/.env.example src/.env # Or manually create src/.env based on src/.env.example ``` 3. **Start the app with MariaDB:** ```sh docker-compose --profile mysql up -d ``` This will start the app, Nginx, MariaDB, Redis, and Mailpit containers. 4. **Install Composer dependencies:** ```sh docker-compose exec app composer install ``` 5. **Generate the application key:** ```sh docker-compose exec app php artisan key:generate ``` 6. **Run database migrations and seeders:** ```sh docker-compose exec app php artisan migrate --seed ``` 7. **Access the app:** - Web: [http://localhost:8080](http://localhost:8080) - Admin: [http://localhost:8080/admin/login](http://localhost:8080/admin/login) - Mailpit: [http://localhost:8025](http://localhost:8025) ## Useful Commands - **Stop all containers:** ```sh docker-compose down ``` - **Rebuild containers after changes:** ```sh docker-compose build --no-cache ``` - **Run tests:** ```sh 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 `.env` has `DB_HOST=mysql` and `DB_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 `3306` internally. - For other issues, check logs: ```sh docker-compose logs --tail=100 ``` --- For more details, see the `docker-compose.yml` and `src/.env.example` files.