A comprehensive Docker container build and management toolkit for multi-stack application development. Supports PHP, Node.js, Python, Java applications with PostgreSQL, MySQL, MariaDB, MongoDB, and Neo4j databases.
Available in three implementations: PHP, Python, and Node.js - choose the one that best fits your workflow!
composer require dsdobrzynski/dapp-bkUsage:
# Global install
composer global require dsdobrzynski/dapp-bk
dapp-bk build
# Project install
vendor/bin/dapp-bk buildpip install dapp-bkUsage:
dapp-bk-py build
dapp-bk-py composer:install
dapp-bk-py network:fixnpm install -g @dsdobrzynski/dapp-bkUsage:
dapp-bk-node build
dapp-bk-node composer:install
dapp-bk-node network:fixgit clone https://github.com/dsdobrzynski/dapp-bk
cd dapp-bk
# For PHP
composer install
php bin/dapp-bk build
# For Python
pip install -e .
dapp-bk-py build
# For Node.js
npm install
node nodejs/bin/dapp-bk-node.js build-
Install the package (choose your preferred method from Installation above)
-
Copy the
.env.examplefile to your project root:
When installed via Composer:
cp vendor/dsdobrzynski/dapp-bk/.env.example .envWhen installed via pip:
# Find the package location
pip show dapp-bk | grep Location
# Then copy from that location, or download from GitHub
curl -o .env https://raw.githubusercontent.com/dsdobrzynski/dapp-bk/main/.env.exampleWhen installed via npm:
cp node_modules/@dsdobrzynski/dapp-bk/.env.example .envYour project structure should look like:
your-project/
├── .env # Your configuration (in project root)
├── composer.json # (if using PHP)
├── package.json # (if using Node.js)
├── docker/ # Optional: custom Dockerfiles
│ ├── app/
│ └── data-rel/
├── src/ # Your application code
└── vendor/ # (if using PHP)
└── dsdobrzynski/
└── dapp-bk/ # Installed package
- Configure your environment:
# Edit .env with your project-specific settings
nano .env # or your preferred editorRequired settings:
PROJECT_NAME- Your project identifierAPP_TYPE- Application type (php-apache, node, python, java)APP_HOST_PORT- Port for accessing your app (e.g., 8080)APP_HOST_VOLUME_PATH- Path to your source code (e.g., "./src")DATA_REL_TYPE- Database type (postgres, mysql, mariadb)
- Build and start containers:
PHP:
dapp-bk build
# or: php vendor/bin/dapp-bk buildPython:
dapp-bk-py buildNode.js:
dapp-bk-node buildAll three implementations (PHP, Python, Node.js) support the same commands:
Build and start application and database containers based on your .env configuration.
# PHP
dapp-bk build [options]
# Python
dapp-bk-py build [options]
# Node.js
dapp-bk-node build [options]Options:
--rebuild-app- Force rebuild of application container--rebuild-data- Force rebuild of database containers--import-data- Import data into database containers
Examples:
# Normal build (reuses existing containers) - PHP version
dapp-bk build
# Rebuild app container - Python version
dapp-bk-py build --rebuild-app
# Rebuild everything and import data - Node.js version
dapp-bk-node build --rebuild-app --rebuild-data --import-dataInstall Composer dependencies in the running application container.
# PHP
dapp-bk composer:install
# Python
dapp-bk-py composer:install
# Node.js
dapp-bk-node composer:installThis command:
- Detects your running app container
- Installs Composer if not present
- Runs
composer installinside the container
Fix common Docker network connectivity problems.
# PHP
dapp-bk network:fix
# Python
dapp-bk-py network:fix
# Node.js
dapp-bk-node network:fixThis command handles platform-specific network issues on Windows and Linux.
Create .env from .env.example:
# Project Configuration
PROJECT_NAME=my-project
# Application Type (php-apache, node, python, java)
APP_TYPE=php-apache
APP_HOST_PORT=8080
# Relational Database (postgres, mysql, mariadb)
DATA_REL_TYPE=postgres
DATA_REL_HOST_PORT=5432
# Non-Relational Database (mongodb, neo4j, or leave empty)
DATA_NONREL_TYPE=
DATA_NONREL_HOST_PORT=
# Volume Mounts
APP_VOLUME_HOST=./src
APP_VOLUME_CONTAINER=/var/www/html
# AWS ECR (if using private images)
APP_AWS_CLI_PROFILE=
APP_AWS_REGION=
APP_AWS_ACCOUNT_ID=
APP_REPO_NAME=
APP_IMAGE_TAG=php-apache- PHP with Apache web server (default)node- Node.js applicationspython- Python (Flask/Django)java- Java (Spring Boot)
Relational:
postgres- PostgreSQL (default)mysql- MySQLmariadb- MariaDB
Non-Relational:
mongodb- MongoDBneo4j- Neo4j graph database
The toolkit includes pre-configured Dockerfiles:
docker/
├── app/
│ ├── Dockerfile-app-php
│ ├── Dockerfile-app-node
│ ├── Dockerfile-app-python
│ └── Dockerfile-app-java
├── data-rel/
│ ├── Dockerfile-data-postgres
│ ├── Dockerfile-data-mysql
│ └── Dockerfile-data-mariadb
└── data-nonrel/
├── Dockerfile-data-mongodb
└── Dockerfile-data-neo4j
Override default Dockerfiles in your .env:
APP_DOCKERFILE=docker/app/Dockerfile-app-custom
DATA_REL_DOCKERFILE=docker/data-rel/Dockerfile-data-customMount your local source code directory into the container for live development. This is the recommended approach for local development as changes to your code are immediately reflected in the running container without requiring a rebuild.
Configuration in .env:
# Map local source code to container webroot
APP_HOST_VOLUME_PATH="/absolute/path/to/your/sourcecode"
APP_CONTAINER_VOLUME_PATH="/var/www/html"Platform-Specific Examples:
Windows:
APP_HOST_VOLUME_PATH="C:/Users/yourname/projects/myapp/src"
APP_CONTAINER_VOLUME_PATH="/var/www/html"Linux/Mac:
APP_HOST_VOLUME_PATH="/home/yourname/projects/myapp/src"
APP_CONTAINER_VOLUME_PATH="/var/www/html"Relative Path (from project root):
APP_HOST_VOLUME_PATH="./src"
APP_CONTAINER_VOLUME_PATH="/var/www/html"How It Works:
- The toolkit uses Docker's
-vflag to create a bind mount - Your local files at
APP_HOST_VOLUME_PATHare mapped directly toAPP_CONTAINER_VOLUME_PATHin the container - Any changes you make on your host system are immediately visible inside the container
- Perfect for development workflow - no rebuild needed after code changes
For Database Containers:
# PostgreSQL example
DATA_REL_HOST_VOLUME_PATH="/path/to/postgres/data"
DATA_REL_CONTAINER_VOLUME_PATH="/var/lib/postgresql/data"Note: If volume paths are not set or left empty, no volume mapping will be configured and the container will use its internal filesystem only.
For private Docker images from AWS ECR:
APP_AWS_CLI_PROFILE=my-profile
APP_AWS_REGION=us-east-1
APP_AWS_ACCOUNT_ID=123456789012
APP_REPO_NAME=my-app-repo
APP_IMAGE_TAG=latestThe toolkit will automatically authenticate with AWS SSO and ECR.
If you're currently using the bash scripts (scripts/docker-build.sh, scripts/app-build.sh):
Before:
bash app/scripts/docker-build.sh --rebuild-app --import-data
bash app/scripts/app-build.shAfter (choose your preferred language):
PHP:
dapp-bk build --rebuild-app --import-data
dapp-bk composer:installPython:
dapp-bk-py build --rebuild-app --import-data
dapp-bk-py composer:installNode.js:
dapp-bk-node build --rebuild-app --import-data
dapp-bk-node composer:install- PHP >= 7.4
- Composer
- Docker Desktop
- Python >= 3.7
- pip
- Docker Desktop
- Node.js >= 16.0.0
- npm
- Docker Desktop
- Git
- Docker Desktop (Linux or Windows with WSL2)
composer testcomposer cs-fix| Install Method | Testing Status | Assignee |
|---|---|---|
| PHP (Composer) | Complete | @dsdobrzynski |
| Python (pip) | To Do | |
| Node.js (npm) | To Do |
| Application Type | Testing Status | Assignee |
|---|---|---|
| php-apache | In-Progress | @dsdobrzynski |
| node | To Do | |
| python | To Do | |
| java | To Do |
| Database Type | Testing Status | Assignee |
|---|---|---|
| postgres | In-Progress | |
| mysql | In-Progress | |
| mariadb | To Do | |
| mongodb | To Do | |
| neo4j | To Do |
| App / Database Type | PostgreSQL | MySQL | MariaDB | MongoDB | Neo4j |
|---|---|---|---|---|---|
| php-apache | Complete | Complete | Complete | To Do | To Do |
| node | To Do | To Do | To Do | To Do | To Do |
| python | To Do | To Do | To Do | To Do | To Do |
| java | To Do | To Do | To Do | To Do | To Do |
MIT License
Contributions are welcome! Please submit pull requests or open issues on GitHub.
For issues and questions:
- GitHub Issues: https://github.com/dsdobrzynski/dapp-bk/issues
- Documentation: https://github.com/dsdobrzynski/dapp-bk#readme