Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcellodesales/php-apache-mysql-4-cakephp-docker

Docker image for CakePHP Apps that requires MySQL modules.
https://github.com/marcellodesales/php-apache-mysql-4-cakephp-docker

Last synced: 26 days ago
JSON representation

Docker image for CakePHP Apps that requires MySQL modules.

Awesome Lists containing this project

README

        

Docker image for php apache for cake-php apps
=====

Since CakePHP apps require MySQL PDO to be installed,
I found this to be a very time-consuming. I spent around 5 hours to get this
properly configured. CakePHP requires the following:

* Apache Module: Rewrite: http://httpd.apache.org/docs/current/mod/mod_rewrite.html
* Apache Module: Headers: http://httpd.apache.org/docs/2.2/mod/mod_headers.html
* PHP Module: MySQL PDO: http://php.net/manual/en/pdo.installation.php, http://stackoverflow.com/questions/13375061/installing-pdo-driver-on-mysql-linux-server

This image's parent is the latest PHP/Apache image. See more at https://hub.docker.com/_/php/.

Here's a Dockerfile that will work for your CakePHP Application.

```
FROM marcellodesales/php-apache-cakephp-mysql

ADD . /var/www/html

# In case you need write permissions in a given directory, do it here
RUN mkdir /var/www/html/api/tmp && chmod 777 /var/www/html/api/tmp

CMD ["apache2-foreground"]
```

After that, just perform a regular build:

```sh
docker build -t myCakePhpApp .
```

Then you simply run your app!

```sh
docker run -ti myCakePhpApp
```