{"id":14987316,"url":"https://github.com/atsanna/codeigniter4-docker","last_synced_at":"2025-04-13T08:26:39.918Z","repository":{"id":40721105,"uuid":"255387551","full_name":"atsanna/codeigniter4-docker","owner":"atsanna","description":"🐳 PHP Docker Image for CodeIgniter4 development","archived":false,"fork":false,"pushed_at":"2022-09-13T13:49:29.000Z","size":28175,"stargazers_count":136,"open_issues_count":2,"forks_count":93,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-27T00:11:42.033Z","etag":null,"topics":["codeigniter4","docker","docker-compose","docker-image","php"],"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/atsanna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["atsanna"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/atsanna"]}},"created_at":"2020-04-13T16:52:01.000Z","updated_at":"2025-01-15T15:22:17.000Z","dependencies_parsed_at":"2022-07-08T18:52:25.882Z","dependency_job_id":null,"html_url":"https://github.com/atsanna/codeigniter4-docker","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsanna%2Fcodeigniter4-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsanna%2Fcodeigniter4-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsanna%2Fcodeigniter4-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsanna%2Fcodeigniter4-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atsanna","download_url":"https://codeload.github.com/atsanna/codeigniter4-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248682925,"owners_count":21144850,"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":["codeigniter4","docker","docker-compose","docker-image","php"],"created_at":"2024-09-24T14:14:26.218Z","updated_at":"2025-04-13T08:26:39.891Z","avatar_url":"https://github.com/atsanna.png","language":"Shell","readme":"## Docker Image for CodeIgniter4 development\r\n[![Docker Build Status](https://img.shields.io/docker/cloud/build/atsanna/codeigniter4?style=for-the-badge)](https://hub.docker.com/r/atsanna/codeigniter4/)\r\n[![Docker Stars](https://img.shields.io/docker/stars/atsanna/codeigniter4?style=for-the-badge)](https://hub.docker.com/r/atsanna/codeigniter4/)\r\n[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/atsanna/codeigniter4/latest?style=for-the-badge)](https://hub.docker.com/r/atsanna/codeigniter4/)\r\n[![Docker Pulls](https://img.shields.io/docker/pulls/atsanna/codeigniter4?style=for-the-badge)](https://hub.docker.com/r/atsanna/codeigniter4/)\r\n[![Docker Image Size](https://img.shields.io/docker/image-size/atsanna/codeigniter4?latest\u0026style=for-the-badge)](https://hub.docker.com/r/atsanna/codeigniter4/)\r\n\r\nThis repository provides you a development environment without requiring you to install PHP, a web server, and any other server software on your local machine. For this, it requires Docker and Docker Compose.\r\n\r\nBasic example to create your container (tested on Ubuntu 20.04 - Docker version 20.10.11, build dea9396 - docker-compose version 1.25.0 ):\r\n\r\n**NOTE: This package is under early development and is not ready for prime-time.**\r\n\r\n**The old version is still available in the branch called \"old\"**\r\n\r\n## Build Image\r\n\r\nClone thi repository and run:\r\n```\r\n./build.sh\r\n```\r\n\r\nstart the container with php 7.4:\r\n```\r\ndocker container run -it --publish 80:80 --name ci4 -v /localfolder:/var/www/html codeigniter4.2.3:7.4.30-apache\r\n```\r\n\r\nstart the container with php 8.0:\r\n```\r\ndocker container run -it --publish 80:80 --name ci4 -v /localfolder:/var/www/html codeigniter4.2.3:8.0.20-apache\r\n```\r\n\r\nstart the container with php 8.1:\r\n```\r\ndocker container run -it --publish 80:80 --name ci4 -v /localfolder:/var/www/html codeigniter4.2.3:8.1.9-apache\r\n```\r\n\r\n## Installation\r\n\r\n1. Install [docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) ;\r\n\r\n2. Copy `docker-compose.yml` file to your project root path, and edit it according to your needs ;\r\n\r\n3. Uncomment, in the `docker-compose.yml` file, the image you want to use it ;\r\n\r\n4. From your project directory, start up your application by running:\r\n\r\n```sh\r\ndocker-compose up -d\r\n```\r\n\r\n4. From your project directory, stop your application by running:\r\n\r\n```sh\r\ndocker-compose down --volumes\r\n```\r\n\r\n# Environment variables summary:\r\n\r\n## Environment file\r\n### allowed values are: [`0`, `1`]\r\n- `REGEN_ENV_FILE` - if 1, the `.env` file will be created and overwritten when the container starts\r\n\r\n## App Configuration\r\n- `CI_ENVIRONMENT` - ENVIRONMENT [`production`, `develompent`, `tests`]\r\n- `APP_BASE_URL` - URL to your CodeIgniter root. Typically this will be your base URL, WITH a trailing slash [`http://localhost/`]\r\n- `APP_FORCE_GLOBAl_SECURE_REQUESTS` - If true, this will force every request made to this application to be made via a secure connection (HTTPS) [`true`, `false`]\r\n\r\n\r\n## App Session\r\n- `APP_SESSION_DRIVER` - [`CodeIgniter\\Session\\Handlers\\FileHandler`]\r\n- `APP_SESSION_COOCKIE_NAME` - [`ci_session`]\r\n- `APP_SESSION_EXPIRATION` - [`7200`]\r\n- `APP_SESSION_SAVE_PATH` - [`null`]\r\n- `APP_SESSION_MATCH_CHIP` - [`true`, `false`]\r\n- `APP_SESSION_TIME_TO_UPDATE` - [`300`]\r\n- `APP_SESSION_REGENERATE_DESTROY` - [`true`, `false`]\r\n- `APP_CSP_ENABLED` - [`true`, `false`]\r\n\r\n## Default Database Configuration\r\n- `DB_DEFAULT_HOSTNAME` - default hostname [`127.0.0.1`]\r\n- `DB_DEFAULT_DATABASE` - default database name\r\n- `DB_DEFAULT_USERNAME` - default database username\r\n- `DB_DEFAULT_PASSWORD` - default database password\r\n- `DB_DEFAULT_DRIVER` - default database driver [`MySQLi`, `SQLSRV`, `Postgre`, `OCI8`, `SQLite3`]\r\n- `DB_DEFAULT_PORT` - default database port [`3306`, `1443`, `5432`, `1521`]\r\n- `DB_DEFAULT_PREFIX` - default database prefix\r\n\r\n## Tests Database Configuration\r\n- `DB_TESTS_HOSTNAME` - tests hostname [`127.0.0.1`]\r\n- `DB_TESTS_DATABASE` - tests database name\r\n- `DB_TESTS_USERNAME` - tests database username\r\n- `DB_TESTS_PASSWORD` - tests database password\r\n- `DB_TESTS_DRIVER` - tests database driver [`MySQLi`, `SQLSRV`, `Postgre`, `OCI8`, `SQLite3`]\r\n- `DB_TESTS_PORT` - tests database port [`3306`, `1443`, `5432`, `1521`]\r\n- `DB_TESTS_PREFIX` - tests database prefix\r\n\r\n- `DB_DEFAULT_PREFIX` - default database prefix\r\n\r\n## Content Secure Policy Configuration\r\n- `CONTENT_SECURE_POLICY_REPORT_ONLY` - Default CSP report context [`true`, `false`]\r\n- `CONTENT_SECURE_POLICY_DEFAULT_SRC` - Will default to self if not overridden [`none`]\r\n- `CONTENT_SECURE_POLICY_SCRIPT_SRC` - Lists allowed scripts' URLs [`self`]\r\n- `CONTENT_SECURE_POLICY_STYLE_SRC` - Lists allowed stylesheets' URLs [`self`]\r\n- `CONTENT_SECURE_POLICY_IMAGE_SRC` - Defines the origins from which images can be loaded [`self`]\r\n- `CONTENT_SECURE_POLICY_BASE_URI` - Restricts the URLs that can appear in a page's `\u003cbase\u003e` element [`null`]\r\n- `CONTENT_SECURE_POLICY_CHILD_SRC` - Lists the URLs for workers and embedded frame contents [`null`]\r\n- `CONTENT_SECURE_POLICY_CONNECT_SRC` - Limits the origins that you can connect to (via XHR, WebSockets, and EventSource)[`self`]\r\n- `CONTENT_SECURE_POLICY_FONT_SRC` - Specifies the origins that can serve web fonts [`null`]\r\n- `CONTENT_SECURE_POLICY_FORM_ACTION` - Lists valid endpoints for submission from `\u003cform\u003e` tags [`null`]\r\n- `CONTENT_SECURE_POLICY_FRAME_ANCESTORS` - Specifies the sources that can embed the current page [`null`]\r\n- `CONTENT_SECURE_POLICY_RFAME_SRC` - The frame-src directive restricts the URLs which may be loaded into nested browsing contexts [`null`]\r\n- `CONTENT_SECURE_POLICY_MEDIA_SRC` - Restricts the origins allowed to deliver video and audio [`null`]\r\n- `CONTENT_SECURE_POLICY_OBJECT_SRC` - Allows control over Flash and other plugins [`null`]\r\n- `CONTENT_SECURE_POLICY_PLUGIN_TYPES` - Limits the kinds of plugins a page may invoke [`null`]\r\n- `CONTENT_SECURE_POLICY_REPORT_URI` - Specifies a URL where a browser will send reports when a content security policy is violated [`null`]\r\n- `CONTENT_SECURE_POLICY_SANDBOX` - List of actions allowed [`true`, `false`]\r\n- `CONTENT_SECURE_POLICY_UPGRADE_INSECURE_REQUESTS` - Instructs user agents to rewrite URL schemes, changing  HTTP to HTTPS. This directive is for websites with large numbers of old URLs that need to be rewritten[`true`, `false`]\r\n\r\n## Cookie Configuration\r\n- `COOKIE_PREFIX` - Set a cookie name prefix if you need to avoid collisions [``]\r\n- `COOKIE_EXPIRES` - Default expires timestamp for cookies [`0`]\r\n- `COOKIE_PATH` - Typically will be a forward slash [`/`]\r\n- `COOKIE_DOMAIN` - Set to `.your-domain.com` for site-wide cookies [``]\r\n- `COOKIE_SECURE` - Cookie will only be set if a secure HTTPS connection exists [`true`, `false`]\r\n- `COOKIE_HTTP_ONLY` - Cookie will only be accessible via HTTP(S) (no JavaScript) [`true`, `false`]\r\n- `COOKIE_SAME_SITE` - Configure cookie SameSite setting [`None`, `Lax`, `Strict`, `''`]\r\n- `COOKIE_RAW` - This flag allows setting a \"raw\" cookie [`true`, `false`]\r\n\r\n## Encryption Configuration\r\n- `ENCRYPTION_KEY` - If you use the Encryption class you must set an encryption key (seed) [``]\r\n- `ENCRYPTION_DRIVER` - One of the supported encryption drivers [`OpenSSL`, `Sodium`]\r\n- `ENCRYPTION_BLOCK_SIZE` - This is the number of bytes that will be padded to the plaintext message before it is encrypted [`16`]\r\n- `ENCRYPTION_DIGEST` - HMAC digest to use [`SHA256`, `SHA512`]\r\n\r\n## Honeypot Configuration\r\n- `HONEYPOT_HIDDEN` - Makes Honeypot visible or not to human [`true`, `false`]\r\n- `HONEYPOT_LABEL` - Honeypot Label Content [`Fill This Field`]\r\n- `HONEYPOT_NAME` - Honeypot Field Name [`honeypot`]\r\n- `HONEYPOT_TEMPLATE` - Honeypot HTML Template [`\u003clabel\u003e{label}\u003c/label\u003e\u003cinput type=\"text\" name=\"{name}\" value=\"\"/\u003e`]\r\n- `HONEYPOT_CONTAINER` - Honeypot container [`\u003cdiv style=\"display:none\"\u003e{template}\u003c/div\u003e`]\r\n\r\n## Security Configuration\r\n- `SECURITY_CSRF_PROTECTION` - Protection Method for Cross Site Request Forgery protection [`cookie`, `session`]\r\n- `SECURITY_TOKEN_RANDOMIZE` - Randomize the CSRF Token for added security [`true`, `false`]\r\n- `SECURITY_TOKEN_NAME` - Token name for Cross Site Request Forgery protection [`csrf_token_name`]\r\n- `SECURITY_HEADER_NAME` - Header name for Cross Site Request Forgery protection [`X-CSRF-TOKE`]\r\n- `SECURITY_COOKIE_NAME` - Cookie name for Cross Site Request Forgery protection [`csrf_cookie_name`]\r\n- `SECURITY_EXPIRES` - Expiration time for Cross Site Request Forgery protection cookie [`7200`]\r\n- `SECURITY_REGENERATE` - Regenerate CSRF Token on every submission [`true`, `false`]\r\n- `SECURITY_REDIRECT` - Redirect to previous page with error on failure [`true`, `false`]\r\n- `SECURITY_SAME_SITE` - Setting for CSRF SameSite cookie token [`None`, `Lax`, `Strict`, `''`]\r\n\r\n## Logger Configuration\r\n- `LOGGER_THRESHOLD` - You can enable error logging by setting a threshold over zero [`0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`]\r\n    - Threshold options are:\r\n        * 0 = Disables logging, Error logging TURNED OFF\r\n        * 1 = Emergency Messages - System is unusable\r\n        * 2 = Alert Messages - Action Must Be Taken Immediately\r\n        * 3 = Critical Messages - Application component unavailable, unexpected exception.\r\n        * 4 = Runtime Errors - Don't need immediate action, but should be monitored.\r\n        * 5 = Warnings - Exceptional occurrences that are not errors.\r\n        * 6 = Notices - Normal but significant events.\r\n        * 7 = Info - Interesting events, like user logging in, etc.\r\n        * 8 = Debug - Detailed debug information.\r\n        * 9 = All Messages\r\n\r\n## Curl Request Configuration\r\n- `CURL_REQUEST_SHARE_OPTIONS` - Whether share options between requests or not [`true`, `false`]\r\n\r\n## Sendmail Configuration\r\n- `ROOT_EMAIL` - The user that gets all mail for userids less than 1000. Ifblank, address rewriting is disabled.\r\n- `MAIL_SERVER` - The host to send mail to, in the form host.\r\n- `MAIL_SERVER_PORT` - The port to send mail to, in the form host.\r\n- `MAIL_SERVER_USER` - The user name to use for SMTP AUTH.\r\n- `MAIL_SERVER_PASSWORD` - The password to use for SMTP AUTH.\r\n- `MAIL_SERVER_TLS` - Specifies whether ssmtp uses TLS to talk to the SMTP server.\r\n- `MAIL_SERVER_STARTTLS` - Specifies whether ssmtp does a EHLO/STARTTLS before starting SSL negotiation.\r\n\r\n## List of Apache Modules pre-installed on these Docker images (apachectl -M)\r\n\r\n- `core_module` (static)\r\n- `so_module` (static)\r\n- `watchdog_module` (static)\r\n- `http_module` (static)\r\n- `log_config_module` (static)\r\n- `logio_module` (static)\r\n- `version_module` (static)\r\n- `unixd_module` (static)\r\n- `access_compat_module` (shared)\r\n- `alias_module` (shared)\r\n- `auth_basic_module` (shared)\r\n- `authn_core_module` (shared)\r\n- `authn_file_module` (shared)\r\n- `authz_core_module` (shared)\r\n- `authz_host_module` (shared)\r\n- `authz_user_module` (shared)\r\n- `autoindex_module` (shared)\r\n- `cgi_module` (shared)\r\n- `deflate_module` (shared)\r\n- `dir_module` (shared)\r\n- `env_module` (shared)\r\n- `expires_module` (shared)\r\n- `fcgid_module` (shared)\r\n- `filter_module` (shared)\r\n- `headers_module` (shared)\r\n- `mime_module` (shared)\r\n- `mpm_prefork_module` (shared)\r\n- `negotiation_module` (shared)\r\n- `php_module` (shared)\r\n- `proxy_module` (shared)\r\n- `proxy_http_module` (shared)\r\n- `reqtimeout_module` (shared)\r\n- `rwrite_module` (shared)\r\n- `setenvif_module` (shared)\r\n- `socache_shmcb_module` (shared)\r\n- `ssl_module` (shared)\r\n- `status_module` (shared)\r\n\r\n\r\n## List of PHP Modules pre-installed on these Docker images (php -m)\r\n\r\n[PHP Modules]\r\n- `amqp`\r\n- `ast`\r\n- `bcmath`\r\n- `bz2`\r\n- `calendar`\r\n- `Core`\r\n- `csv`\r\n- `ctype`\r\n- `curl`\r\n- `date`\r\n- `dba`\r\n- `decimal`\r\n- `dom`\r\n- `ds`\r\n- `enchant`\r\n- `ev`\r\n- `event`\r\n- `excimer`\r\n- `exif`\r\n- `FFI`\r\n- `fileinfo`\r\n- `filter`\r\n- `ftp`\r\n- `gd`\r\n- `geospatial`\r\n- `gettext`\r\n- `gmp`\r\n- `gnupg`\r\n- `grpc`\r\n- `hash`\r\n- `http`\r\n- `iconv`\r\n- `igbinary`\r\n- `imagick`\r\n- `imap`\r\n- `inotify`\r\n- `intl`\r\n- `json`\r\n- `json_post`\r\n- `ldap`\r\n- `libsmbclient`\r\n- `libxml`\r\n- `lzf`\r\n- `mailparse`\r\n- `maxminddb`\r\n- `mbstring`\r\n- `mcrypt`\r\n- `memcache`\r\n- `memcached`\r\n- `mongodb`\r\n- `msgpack`\r\n- `mysqli`\r\n- `mysqlnd`\r\n- `OAuth`\r\n- `oci8`\r\n- `odbc`\r\n- `opencensus`\r\n- `openssl`\r\n- `openswoole`\r\n- `pcntl`\r\n- `pcov`\r\n- `pcre`\r\n- `PDO`\r\n- `pdo_dblib`\r\n- `PDO_Firebird`\r\n- `pdo_mysql`\r\n- `PDO_OCI`\r\n- `PDO_ODBC`\r\n- `pdo_pgsql`\r\n- `pdo_sqlite`\r\n- `pdo_sqlsrv`\r\n- `pgsql`\r\n- `Phar`\r\n- `posix`\r\n- `pspell`\r\n- `raphf`\r\n- `readline`\r\n- `redis`\r\n- `Reflection`\r\n- `SeasLog`\r\n- `session`\r\n- `shmop`\r\n- `SimpleXML`\r\n- `smbclient`\r\n- `snmp`\r\n- `soap`\r\n- `sockets`\r\n- `sodium`\r\n- `SPL`\r\n- `sqlite3`\r\n- `sqlsrv`\r\n- `ssh2`\r\n- `standard`\r\n- `tokenizer`\r\n- `uuid`\r\n- `xdebug`\r\n- `xml`\r\n- `xmldiff`\r\n- `xmlreader`\r\n- `xmlrpc`\r\n- `xmlwriter`\r\n- `xsl`\r\n- `yac`\r\n- `yaml`\r\n- `yar`\r\n- `Zend OPcache`\r\n- `zend_test`\r\n- `zephir_parser`\r\n- `zip`\r\n- `zlib`\r\n- `zstd`\r\n\r\n[Zend Modules]\r\n- `Xdebug`\r\n- `Zend OPcache`\r\n\r\n## Changelog\r\n\r\nYou can find the changes made in the [changelog](CHANGELOG.md) file \r\n\r\n## Contributing\r\n\r\nContributions are welcome!\r\nLeave an issue on Github, or create a Pull Request.\r\n\r\n## Licence\r\n\r\nThis work is under [MIT](LICENSE) licence.\r\n","funding_links":["https://github.com/sponsors/atsanna","https://www.paypal.me/atsanna"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsanna%2Fcodeigniter4-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatsanna%2Fcodeigniter4-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsanna%2Fcodeigniter4-docker/lists"}