Installation & Docker Setup
This project is fully containerized using Docker, making setup consistent across all environments. Follow this guide to get up and running in minutes.
Table of Contents
1. Prerequisites
Before you begin, ensure you have the following installed:
- Docker Desktop (Windows/Mac) or Docker Engine (Linux)
- Git
2. Docker Setup
Step 1: Clone the Repository
git clone https://github.com/your-org/ci4-core-new.git
cd ci4-core-newStep 2: Environment Setup
Copy the example environment file:
cp .env.example .envNote: The default settings in .env are pre-configured to work with the Docker containers (database host is mysql, redis host is redis).
Step 3: Start Containers
Run the application in detached mode:
docker-compose up -d --buildThis will start:
- Nginx (Web Server) at
http://localhost:81 - PHP-FPM (Application)
- MySQL (Database)
- Redis (Cache & Session)
- Prometheus (Metrics) at
http://localhost:9090 - Grafana (Dashboards) at
http://localhost:2999
Step 4: Verify Installation
Visit http://localhost:81 in your browser. You should see the welcome page.
3. Common Commands
Here are the most useful commands for daily development:
Accessing the Container
To run Artisan/Spark commands or Composer, enter the PHP container:
# Enter the PHP container shell
docker-compose exec php bash
# Run Spark commands directly
docker-compose exec php php spark routes
docker-compose exec php php spark migrateLogs
View logs for all services or a specific one:
# Follow all logs
docker-compose logs -f
# Follow PHP logs only
docker-compose logs -f phpStopping the App
# Stop containers
docker-compose stop
# Stop and remove containers/networks
docker-compose down4. Troubleshooting
Port Conflicts
If port 81 or 3306 is already in use, modify docker/env:
NGINX_PORT=8081 # Change to available portPermission Issues (Linux)
If `writable/` directory is not writable:
docker-compose exec php chown -R www-data:www-data /var/www/html/writable