Skip to content

Latest commit

 

History

History
90 lines (57 loc) · 2.34 KB

File metadata and controls

90 lines (57 loc) · 2.34 KB

Docker Development Environment

This project includes a Docker-based development environment that allows you to run the application and its dependencies in isolated containers.

Prerequisites

Setup

  1. Build and start the containers:

    docker compose -f compose.dev.yml up --build -d

    This command will build the Docker images and start the services in detached mode.

  2. Install Composer dependencies:

    Open a new terminal and run the following command to install the PHP dependencies using Composer.

    docker compose -f compose.dev.yml exec workspace composer install
  3. Copy the environment file:

    cp .env.example .env
  4. Generate the application key:

    docker compose -f compose.dev.yml exec workspace php artisan key:generate
  5. Run database migrations:

    docker compose -f compose.dev.yml exec workspace php artisan migrate
  6. Seed the database (optional):

    To populate the database with sample data, run the following command:

    docker compose -f compose.dev.yml exec workspace php artisan db:seed

Usage

  • Accessing the application:

    Once the containers are running, you can access the application in your web browser at http://localhost.

  • Running Artisan commands:

    To run any artisan command, use docker compose exec workspace php artisan <command>. For example:

    docker compose -f compose.dev.yml exec workspace php artisan route:list
  • Running Composer commands:

    To run any composer command, use docker compose exec workspace composer <command>. For example:

    docker compose -f compose.dev.yml exec workspace composer update
  • Running NPM commands:

    To run any npm command, use docker compose exec workspace npm <command>. For example, to compile the frontend assets:

    docker compose -f compose.dev.yml exec workspace npm install
    docker compose -f compose.dev.yml exec workspace npm run dev
  • Stopping the environment:

    To stop the containers, run:

    docker compose -f compose.dev.yml down