{"id":15046372,"url":"https://github.com/manmath/dockerci","last_synced_at":"2026-03-02T05:32:33.328Z","repository":{"id":62523407,"uuid":"71450048","full_name":"manmath/DockerCI","owner":"manmath","description":"Basic configuration for running a CodeIgniter package with docker and ngnix","archived":false,"fork":false,"pushed_at":"2017-07-13T11:15:36.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-06T21:44:35.584Z","etag":null,"topics":["codeigniter","docker","docker-documentation","dockerci","mailhog"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manmath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-20T10:01:39.000Z","updated_at":"2020-03-20T09:05:35.000Z","dependencies_parsed_at":"2022-11-02T14:01:08.110Z","dependency_job_id":null,"html_url":"https://github.com/manmath/DockerCI","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manmath%2FDockerCI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manmath%2FDockerCI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manmath%2FDockerCI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manmath%2FDockerCI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manmath","download_url":"https://codeload.github.com/manmath/DockerCI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240486624,"owners_count":19809208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeigniter","docker","docker-documentation","dockerci","mailhog"],"created_at":"2024-09-24T20:53:02.404Z","updated_at":"2026-03-02T05:32:33.285Z","avatar_url":"https://github.com/manmath.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nDocker Compose structure to quickly startup CodeIgniter PHP Framework projects.\n\n[![MicroBadger](https://images.microbadger.com/badges/image/manmath/dockerci.svg)](https://microbadger.com/images/manmath/dockerci \"Get your own image badge on microbadger.com\")\n[![Docker Image](https://img.shields.io/badge/docker-image-blue.svg?style=gradient-radius)](https://hub.docker.com/r/manmath/dockerci/)\n[![Stable Release](https://img.shields.io/badge/stable-1.0.2-green.svg?style=gradient-radius)](https://packagist.org/packages/manmath/dockerci)\n[![Changelog](https://img.shields.io/badge/changelog-1.0.2-green.svg?style=gradient-radius)](https://github.com/manmath/DockerCI/blob/master/CHANGELOG.md)\n[![CodeIgniter](https://img.shields.io/badge/CodeIgniter-3.1.5-orange.svg?style=gradient-radius)](https://codeigniter.com/)\n[![DockerCI](https://img.shields.io/badge/DockerCI-master-yellow.svg?style=gradient-radius)](https://github.com/manmath/DockerCI)\n[![MIT License](https://img.shields.io/badge/license-MIT-yellow.svg?style=gradient-radius)](https://github.com/manmath/DockerCI/blob/master/LICENSE.txt)\n\nDockerCI creates the necessary Docker containers (webserver, database, php, mail) to run your CodeIgniter Framework project.\nThe package provides a wrapper script in `bin/dockerci` which simplifies the handling of docker and does all the configuration necessary.\n\nWe created this package to make development on CodeIgniter Framework projects easier and\nto create a simple reusable package which can easily be maintained and serves well for the standard project.\n\nDevelopment will continue further as the package is already reused in several projects.\nContributions and feedback are very welcome.\n\n## Install docker\n\n    https://docs.docker.com/installation/ (tested with docker v1.9 - v17.03)\n\n## Install docker-compose\n\nWe use docker-compose to do all the automatic configuration:\n\n    http://docs.docker.com/compose/install/ (tested with docker-compose v1.5 - v1.11.2)\n\nThe repository contains a Dockerfile which will automatically be built in the [docker hub](https://hub.docker.com/r/manmath/dockerci/)\nafter each change and used by docker-compose to build the necessary containers.\n\n## On a Mac or Windows\n\nIt has been tested working with docker for Mac but not yet with docker for Windows.\nFeel free to try it out and let us know if you cannot wait.\n\n## Install dockerci into your distribution\n\nAdd `manmath/dockerci` as dev dependency in your composer, using the latest stable release is highly recommended.\n\n*Example*:\n\n```\ncomposer require --dev manmath/dockerci 1.0.*\n```\n\n## Run dockerci\n\n    bin/dockerci up -d\n\nThe command will echo the url with which you can access your project. Add the hostname then to your `/etc/hosts`\nand set the ip to your docker host (default for linux is 0.0.0.0) or your boot2docker ip. You can also use any\nsubdomain with `*.hostname` and it will point to the same server. What you need to do is to add exact subdomain name\nto your `/etc/hosts`.\n\nThe parameter `-d` will keep it running in the background until you run:\n\n    bin/dockerci stop\n\nThe default database configuration for your `database.php` is:\n\n    $db['default'] = array(\n        'hostname' =\u003e 'db',\n        'username' =\u003e 'root',\n        'password' =\u003e 'root',\n        'database' =\u003e 'dockerci'\n    );\n\nAlso note that there is a second database `dockerci_test` available for your testing context. The testing context url\nwould be `test.hostname` and this hostname should be added to your `/etc/hosts` too.\n\n## Check the status\n\n    bin/dockerci ps\n\nThis will show the running containers. The `data` container can be inactive to do it's work.\n\n# Tips \u0026 Tricks\n\n## Using different CI_ENV\n\n    CI_ENV=production bin/dockerci up -d\n\nDockerCI also setup a sub-context for testing depends on the current context you are running. In the above example,\nit would be `production/testing`. Anyway, you can only use the parent context with the `bin/dockerci` command. So when\nthere is a need to execute command for the testing context, you need to first get into `app` container and then call the\ncommand prefixed by the context variable.\n\n    CI_ENV=production bin/dockerci up -d\n    bin/dockerci run app /bin/bash\n\n## Using MailHog to test mailing\n\n    smtp_host = 'mail'\n    smtp_port = '1025'\n\nAnd open `MyCIProject:8025` in your browser (use your own hostname) to see your mails.\n\nSend emails from your CodeIgniter app and have fun.\n\n## Running a shell in one of the service containers\n\n    bin/dockerci run SERVICE /bin/bash\n\nSERVICE can currently be `app`, `web`, `data` or `db`.\n\n## Access project url when inside `app` container\n\nAs of current docker doesn't support bi-directional link, you cannot access web container from app container.\nBut in some case you will need this connection. For example in behat tests without selenium, you need the url of\nyour site in `testing` context while running the tests has to be done inside the `app` container.\n\nDockerCI adds additional script after starting all containers to fetch the IP address of web container and\nappend it to `/etc/hosts` inside app container as below:\n\n```\nWEB_CONTAINER_IP    project-url\nWEB_CONTAINER_IP    test.project-url\n```\n\n## Access database inside container from docker host\n\nWhile you can easily login to shell of the `db` container with `bin/dockerci run db /bin/bash`\nand execute your mysql commands, there are some cases that you want to run mysql commands directly\nfrom your host without having to login to the `db` container first. One of the best use cases,\nfor example, is to access the databases inside the container from MySQL Workbench tool.\nTo be able to do that, we have mapped database port inside the container (which is `3306`) to your\nhost machine through `3307` port.\n\n![Screenshot of MySQL Workbench interface](/docs/mysql-workbench.png \"MySQL Workbench interface\")\n\n## Attach to a running service\n\nRun `bin/dockerci ps` and copy the container's name that you want to attach to.\n\nRun `docker exec -it \u003ccontainername\u003e /bin/bash` with the name you just copied.\nWith this you can work in a running container instead of creating a new one.\n\n## Check open ports in a container\n\n    bin/dockerci run SERVICE netstat --listen\n\n# Further reading\n\n* [blog post on php-fpm](http://mattiasgeniar.be/2014/04/09/a-better-way-to-run-php-fpm/)\n* [nginx+php-fpm+mysql tutorial](http://www.lonelycoder.be/nginx-php-fpm-mysql-phpmyadmin-on-ubuntu-12-04/)\n* [Docker documentation](http://docs.docker.com/reference/builder/)\n* [docker-compose documentation](http://docs.docker.com/compose)\n* [nginx.conf for CI](https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/)\n* [boot2docker version which supports nfs](https://vagrantcloud.com/yungsang/boxes/boot2docker)\n* [MailHog](https://github.com/mailhog/MailHog/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanmath%2Fdockerci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanmath%2Fdockerci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanmath%2Fdockerci/lists"}