Files
bhoza-shift-manager/src/README.md

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

Quick Start

  1. Clone the repository:

    git clone <your-repo-url>
    cd bhoza-shift-manager
    
  2. Copy the example environment file:

    cp src/.env.example src/.env
    # Or manually create src/.env based on src/.env.example
    
  3. Start the app with MariaDB:

    docker-compose --profile mysql up -d
    

    This will start the app, Nginx, MariaDB, Redis, and Mailpit containers.

  4. Install Composer dependencies:

    docker-compose exec app composer install
    
  5. Generate the application key:

    docker-compose exec app php artisan key:generate
    
  6. Run database migrations and seeders:

    docker-compose exec app php artisan migrate --seed
    
  7. Access the app:

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 .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:
    docker-compose logs --tail=100
    

For more details, see the docker-compose.yml and src/.env.example files.