This project includes a Docker-based development environment that allows you to run the application and its dependencies in isolated containers.
-
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.
-
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 -
Copy the environment file:
cp .env.example .env
-
Generate the application key:
docker compose -f compose.dev.yml exec workspace php artisan key:generate -
Run database migrations:
docker compose -f compose.dev.yml exec workspace php artisan migrate -
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
-
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
artisancommand, usedocker 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
composercommand, usedocker compose exec workspace composer <command>. For example:docker compose -f compose.dev.yml exec workspace composer update -
Running NPM commands:
To run any
npmcommand, usedocker 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