Skip to content

Dockerized CodeIgniter is a pre-configured development environment for CodeIgniter 4, set up using Docker. It simplifies local development with ready-to-use containers for PHP, MySQL, and Nginx, enabling quick and consistent project setup.

Notifications You must be signed in to change notification settings

Azshurith/Dockerized-Code-Igniter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CodeIgniter 4 Dockerized Template

A ready-to-use Docker environment for developing modern applications with CodeIgniter 4. Includes MySQL, Nginx, and PHP containers with an easy Makefile interface for migrations, seeding, and more.


πŸ“¦ Stack

  • CodeIgniter 4
  • PHP-FPM (in .docker/Php)
  • Nginx (in .docker/Nginx)
  • MySQL 5.7 (in .docker/MySQL)
  • Docker Compose
  • Makefile utility commands

βš™οΈ Quick Start

# Start the app
make project_start

# Stop the app
make project_stop

# Destroy the app and volumes
make project_destroy

Access your project at: http://localhost:8080


πŸ› οΈ Development Utilities

Command Description
make deploy πŸ”§ Opens a shell in the PHP container
make migrate πŸ—‚οΈ Runs all pending database migrations
make make_migration NAME=MigrationName πŸ“„ Creates a new migration file
make seed 🌱 Runs the database seeder inside the container

πŸ“ Project Structure

.
β”œβ”€β”€ .docker/                  # Docker config files
β”‚   β”œβ”€β”€ MySQL/                # MySQL customizations
β”‚   β”œβ”€β”€ Nginx/                # Nginx config (default.conf)
β”‚   └── Php/                  # PHP Dockerfile, custom INIs
β”‚
β”œβ”€β”€ Web/
β”‚   β”œβ”€β”€ app/                  # Main CodeIgniter app
β”‚   β”‚   β”œβ”€β”€ Config/
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ Views/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ public/               # Public folder (index.php, js/)
β”‚   β”œβ”€β”€ tests/                # Automated tests
β”‚   β”œβ”€β”€ vendor/               # Composer dependencies
β”‚   └── writable/             # Cache, logs, session, uploads
β”‚
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Makefile
└── README.md

πŸ§ͺ Testing (Optional)

Run unit tests using:

docker exec -it codeigniter-php vendor/bin/phpunit

πŸ“ Notes

  • Make sure .env is configured for your environment (CI_ENVIRONMENT, database, etc).
  • PHP container uses CodeIgniter CLI tools (php spark).
  • Database data persists via Docker volume.

About

Dockerized CodeIgniter is a pre-configured development environment for CodeIgniter 4, set up using Docker. It simplifies local development with ready-to-use containers for PHP, MySQL, and Nginx, enabling quick and consistent project setup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published