This project provides easy to use docker based development environment for your projects. All the modules are selective & can be enabled based on Environment file (.env)! Supports multiple domains.
- This is for local development only!
- Don't state both apache & nginx in COMPOSE_PROFILES.
- Domain(s) should be available in the hosts file
<your_ip> <your_domain>.
Install docker on your system first. If you already have docker installed, you can skip this step.
- To install on Linux, it is recommended to use Docker Engine.
- To install on other OS, use Docker Desktop (although you can also install this on linux as well).
For using your projects with this, by default you should arrange your projects structure as follows,
| application
|- site1
|- site2
|- site3
|- .....
| localhost (this repository)
But the project structure is flexible. If wanna change the directory of your projects (set other custom path instead of
same level application directory), just change/add the PROJECT_DIR in .env file, which should point to your project directory.
PROJECT_DIR=../path/to/your/projects/directory # supports relative/absolute pathNow lets look into the localhost structure for where your configuration files should be.
| localhost
|- bin
|- configuration # this is where you should put your configuration files
|- apache # your apache Site configuration files (example available in directory)
|- nginx # your nginx Site configuration files (example available in directory)
|- php # your php configuration file (php.ini)
|- ssh # your ssh keys (needed specifically for git ssh authentication)
|- ssl # your ssl certificates
|- docker # this directory should stay untouched
|- compose # docker compose file(s)
|- conf # docker configuration files
|- data # docker data files for persistence
|- logs # container logs
|- .env
|- cruise
|- cruise.bat
- Simply, create
.envfile, place your settings. - Create site configuration file in
localhost/configuration/(nginx or apache). Example configuration available in those directories. - Don't forget to add host file entry for your domain(s) in your local machine.
- Run
cruise startor./cruise start(on linux you must runchmod +x cruisefirst) - Your site(s) will be available in your desired domain(s)
Note: on linux you must run chmod +x cruise first
./cruise start/relaodorcruise start/reloadto start the server or reload with updated Environment variables- If you want to enter in PHP container shell, simply run
cruise coreor./cruise core - To stop the server, simply run
cruise stopor./cruise stop - To restart/reboot the server, simply run
cruise restart/rebootor./cruise restart/reboot - To rebuild the server, simply run
cruise rebuild <service_name>or./cruise rebuild <service_name> - Launch Docker CLI GUI using
cruise lzdor./cruise lzd - You can run any docker compose command using
cruise <command>or./cruise <command>(except the above-mentioned ones)
Modules (Docker Images, Linux Packages, PHP Versions & Extensions, NodeJS) are controlled based on the environment variables. Checkout the .env.example file for example. To further understand these keep reading further.
Sync the internal docker user with the system user using the environment variable UID. In case of linux you can get this
using id -u command which is the UID of current user. In case of windows, you can get with same command if you use cmder
terminal or git-bash.
UID=1000To select the docker image, we used the environment variable COMPOSE_PROFILES. You will include your required modules
in CSV format (i.e. nginx,mysql). Here are the list of modules you can state here,
nginxloads nginx image with php (service: web, php)apacheloads apache with php (service: app)mysqlormariadbloads mysql/mariadb with phpmyadmin (service: mysql-server, mysql-client)postgresqlloads postgresql & pgadmin (service: postgres-server, postgres-client)mongodbloads mongodb & mongo express (service: mongo-server, mongo-client)elasticsearchloads elasticsearch & kibana (service: elasticsearch-server, elasticsearch-client)redisloads redis & redis insight (service: redis-server, redis-client)toolsloads server tools (check below for more info) (service: server-tools)
Note: don't include both nginx & apache
COMPOSE_PROFILES=nginx,postgresqlSelect the PHP version using the environment variable PHP_VERSION. Supports single PHP version.
PHP_VERSION=8.3List your required PHP extensions using the environment variable PHP_EXTENSIONS. Supports CSV formatted list. For the list
of available modules please refer to mlocati docker extension list.
Latest composer will be installed by default, no need to specify it.
PHP_EXTENSIONS=bcmath,zip,gdTo install additional linux packages we used the environment variable LINUX_PACKAGES.
These extensions are additional & not related to your php extensions (as those will be auto installed by PHP_EXTENSIONS).
Supports CSV formatted values.
LINUX_PACKAGES=git,curlYour project is also using node.js? To install it, we used the environment variable NODE_VERSION. Support major version number (i.e. 18/20/...). Also,
supports either of lts or current as well. Check node.js debian source for more details.
Leaving this empty, won't install node.js.
NODE_VERSION=ltsIn addition to the above, you can define the following environment variables as you see fit.
TZTimezone (default: Asia/Dhaka)
HTTP_PORThttp port (default: 80)HTTPS_PORThttps port (default: 443)
PHP_VERSIONPHP version (default: 8.3)UIDThe uid of system user (default: 1000)PHP_EXTENSIONSList of php extensions in csv formatLINUX_PACKAGESList of linux packages in csv formatNODE_VERSIONIf node.js is required, specify version
MYSQL_IMAGEWhat you wanna use?mariadbormysql(default: mariadb)MYSQL_VERSIONThe version formariadbormysql(default: latest)MYSQL_PORTDB port (default: 3306)MYSQL_ROOT_PASSWORDRoot user password (default: 12345)MYSQL_USERDB User (default: devuser)MYSQL_PASSWORDDB password (default: 12345)MYSQL_DATABASEDB name (default: localdb)
MYADMIN_PORTThe client access port (default: 3300)
POSTGRESQL_VERSIONThe version forPostgreSQL(default: latest)POSTGRESQL_PORTDB port (default: 5432)POSTGRES_USERDB user (default: postgres)POSTGRES_PASSWORDDB password (default: postgres)POSTGRES_DATABASEDB name (default: postgres)
PGADMIN_PORTThe client access port (default: 5400)
MONGODB_VERSIONThe version forMongoDB(default: latest)MONGODB_PORTDB port (default: 27017)MONGODB_ROOT_USERNAMEusername (default: root)MONGODB_ROOT_PASSWORDpassword (default: 12345)
ME_VERSIONApp version (default: latest)ME_BA_USERNAMEBasic Auth User (default: root)ME_BA_PASSWORDBasic Auth Password (default: 12345)
ELASTICSEARCH_VERSIONElasticSearch version (default:8.12.2)ELASTICSEARCH_PORTES port (default: 9200)
KIBANA_PORTThe client access port (default: 5601)
REDIS_VERSIONRedis version (default: latest)REDIS_PORTRedis port (default: 6379)
RI_PORTThe client access port (default: 5540)
You can add the localhost/bin directory, to your PATH environment variable for global usage of several commands. These
will be available depending on what you enable in COMPOSE_PROFILES.
** If you have any other docker container running with the same name as of this docker container names, it will end up in conflict!
Available commands:
phpmysqlmysqldumpmariadbmariadb-dumppsqlpg_dumppg_restoreredis-clilzd# Docker CLI GUIcert# Generate ssl certificates, in case you don't have it- Certificate(s) will be generated directly inside the
configuration/ssldirectory - usage:
cert site1.internal site2.com *.site3.com .....
- Certificate(s) will be generated directly inside the
In windows, it is recommended to use cmder terminal or git-bash for better experience.
Well, you can use these tools to help you out. We have created a list of them below. These tools can help you do several things.
This container mounts your application directory as /app inside the container. So you can use these tools on all your projects.
Usable outside docker container:
lzd# Docker CLI GUIcert# Generate ssl certificates, in case you don't have it- Certificate(s) will be generated directly inside the
configuration/ssldirectory - usage:
cert site1.internal site2.com *.site3.com .....
- Certificate(s) will be generated directly inside the
Usable inside docker container:
git(if you need to incorporate ssh keys with git, use theconfiguration/sshdirectory)curlwget- net-tools (available commands:
arp,hostname,ifconfig,netstat,... etc.) git fame# Git contributor statsgit fame -e --enum# Get Normal Counter on Surviving code (low accuracy)git fame -ewMC --enum# Deep Counter on Surviving code (intra-file & inter-file modifier detector, file system independent) more calculation time- Check
git fame -hcommand for command details
owners# generate owners list (i.e for Github:owners | tee .github/CODEOWNERS)git-story# Animated Git story generator (checkgit-story -hfor command details)
- Tunnel support
- SupervisorD with PHP