I’m very new to Docker and I have a CodeIgniter project that I have been working on via my localhost (XAMPP) up until now. I now want to host my project on Docker using GCP.
Would anyone be able to provide guidance as to how I would write a docker-compose.yml to containerise the project with redis, php, mysql and and nginx containers? Also how would I need my CI project structured for it to work?
3
Answers
I use docker with Codeigniter 4 on daily basis. Here’s my structure, although in my structure I’m not using neither redis or nginx. I’m using apache instead.
Folder structure:
As for the config files, here’s the docker-compose.yml
The Dockerfile
my site.conf
On my youtube series about codeigniter 4 I created a github repo that reflects this structure:
I came across this question when I was learning docker and wanted to leave an update here. I’m using bitnami/codeigniter3. This was easy for me as I did not have to migrate my application to Codeigniter 4.
Recently I was having trouble with same thing but somehow I figure it out and I used the below code. Also, I have setup MySQL on a different port as I was running another app on 3306.
Also, added to my github repo. The git code include has some commented code for CI4.