Repository files navigation Docker Dev Setup for CodeIgniter projects
Clone the repo:
git clone https://github.com/TOA-Anakin/codeigniter-docker-dev.git
Rename the cloned repo as desired:
mv codeigniter-docker-dev your_project_name
Check your user ID using the id -u command and update the .docker/.env file accordingly.
cd into the .docker directory and build the Docker containers:
cd your_project_name/.docker
docker compose up -d --build
Before the end of the process you should see a list of newly created (now running) containers:
[+] Running 5/5
✔ Network codeigniter_docker_dev_app
Created 0.2s
✔ Volume " codeigniter_docker_dev_db"
Created 0.0s
✔ Container codeigniter_docker_dev-phpmyadmin-1
Started 0.2s
✔ Container codeigniter_docker_dev-db-1
Started 0.2s
✔ Container codeigniter_docker_dev-nginx-1
Started 0.2s
Open the terminal of the server container (mine is named codeigniter_docker_dev-nginx-1) and create a CodeIgniter project using composer:
docker exec -it codeigniter_docker-nginx-1 bash
composer create-project codeigniter4/appstarter tmpdir
Move the contents of tmpdir into the project root:
mv tmpdir/* . && mv tmpdir/.[! .]* . && rmdir tmpdir
Access your CodeIgniter web app at http://localhost
You can’t perform that action at this time.