Docker compose to setup nginx, php and mysql for codeigniter 4.0.3.
codeigniter-docker
├── docker
│ ├── mysql
│ │ └── based.sql
│ ├── nginx
│ │ └── nginx.conf
│ └── php
│ └── Dockerfile
├── docker-compose.yml
└── reset-db.sh
- nginx → nginx:latest
- php → php:7.4-fpm
- mysql → mysql:5.7
Copy your sql file to docker/mysql with based.sql as a file name.
- Deploy nginx, php-fpm, and mysql using docker-compose
docker-compose up -d
- Stop all container
docker stop leru_nginx leru_mysql leru_php_fpm
- Remove all container
docker rm leru_nginx leru_mysql leru_php_fpm
- Remove php-fpm image
docker rmi codeigniter-docker_php_fpm
- Reset mysql data
bash reset-db.sh