CodeIgniter Forums
Investigating Docker - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Investigating Docker (/showthread.php?tid=74192)



Investigating Docker - richb201 - 08-18-2019

I am investigating using Docker with my existing CI app. What concerns me (from my reading) is that Docker is "environment-agnostic", a part of which seems to be  setting a container to read only. I plan on using 3 Bitnami containers (as per the bitnami documentation), one for Apache, one for php-fpm, and one for MariaDB. What I am concerned about is the way that CI writes out to files to keep track of things such as session variables (actually i don't remember the details but I do remember that something gets written out). 

My plan is to set up a development environment on my Laptop for development and testing. Debugging on the server almost "killed me". Anyone done any investigation into using Docker?


RE: Investigating Docker - albertleao - 08-19-2019

I use multiple docker containers and Kubernetes on AWS.

Not sure what your concerns are, you just need to make sure you map and plan your application correctly. For one, i'd definitely not be using file based sessions on docker. I'd a database/redis/dynamodb based session store. Otherwise, Docker is great for deployments and unit testing.


RE: Investigating Docker - richb201 - 08-19-2019

great. what did you use as the image? I am using bitnami LAMP now and I'd like o stick with that in the container.(s)


RE: Investigating Docker - albertleao - 08-20-2019

(08-19-2019, 06:58 PM)richb201 Wrote: great. what did you use as the image? I am using bitnami LAMP now and I'd like o stick with that in the container.(s)

Honestly, mostly of my workload in kubernetes is actually in NodeJS not php. I use an alpine build.


RE: Investigating Docker - richb201 - 09-17-2019

Thanks. I am just starting out with Docker and don't think I have enough traffic to justify a swarm. Just the basics. I am using bitnami and they claim to have an apache image, a PHP, a mariaDB, and a Codeigniter image. But what do I do with my code? And I also use grocery crud. Does that preclude me from using the prebuilt images? Must I roll my own? Or can I layer my stuff on top with docker-compose?


RE: Investigating Docker - albertleao - 09-17-2019

You can definitely layer stuff with docker-compose. Before diving into it too much, i'd make sure it's something that is right for you. It can be really powerful but very finicky.


RE: Investigating Docker - richb201 - 09-17-2019

(09-17-2019, 05:12 PM)albertleao Wrote: You can definitely layer stuff with docker-compose. Before diving into it too much, i'd make sure it's something that is right for you. It can be really powerful but very finicky.
I can see that! I need to be able to develop and unit/alpha test on my laptop. I took the udemy Docker Mastery course but at least half of it was swarms, which I don't think I need. Layering might be the right thing for me. I don't want to start creating images if I don't have to.

But looking through some examples, it seems that the layering is done with Dockerfile and docker build. So let's say I start with the Code igniter image, then I need to layer on Grocery Crud. I am using the free version, btw, which is a little worrying but I don't want to change too many things at one time. I am also using php 5.6 and CI 3.

So where do I load my code from? Or do I just build an image of my CI development environment directly and then use that as a layer on the Bitnami code igniter image? 

Does anyone know if that is a reasonable way to go?