Devner is a flexible development environment boilerplate designed to work with multiple PHP and Node.js versions, alongside various databases. It leverages Docker and Docker Compose to create an isolated and reproducible environment for development.
- Docker
- Docker Compose
- Make
git clone https://github.com/MarJC5/devner.git
cd devner
make up
./devner.sh
To allow easy access to the Devner anywhere, you can add an alias to your shell configuration file:
./devner.sh alias
# Restart your terminal or run the following command:
source ~/.bashrc # or source ~/.zshrc
# Now you can access Devner from anywhere:
devner
The Devner menu allows you to manage various aspects of your development environment. Below are the available commands:
- up: Start the development environment.
- down: Stop and remove containers, networks, images, and volumes.
- stop: Stop all containers without removing them.
- rebuild: Rebuild the Docker containers.
- delete: Remove all containers and volumes.
- nocache: Remove all containers and volumes and remove cache.
- reload: Reload the frankenphp container to update Caddyfile.
- new-mysql: Create a new MySQL database and user.
- remove-mysql: Remove a MySQL database and user.
- new-postgres: Create a new PostgreSQL database and user.
- remove-postgres: Remove a PostgreSQL database and user.
- postgres: Access the PostgreSQL container.
- mysql: Access the MySQL 8 container.
- node: Access the Node container.
- frankenphp: Access the FrankenPHP container.
- new: Create a new Laravel or WordPress project.
- remove: Remove an existing project.
- ps: Check if the devner container is running.
- alias: Add the devner alias to .bashrc or .zshrc.
- code: Open a project in VSCode.
- wp: Run wp-cli commands.
- add-host: Add a new host to the Caddyfile.
- remove-host: Remove an existing host from the Caddyfile.
- list-hosts: List all hosts in the Caddyfile.
- credit: Show information about the Devner tools and author.
- help: Show this help menu.
- quit: Exit the script.
To start the development environment, run:
devner up
To create a new Laravel project with a MySQL database, run:
devner new laravel myproject mysql
To remove an existing project, run:
devner remove myproject mysql
The following services are defined in the docker-compose.yml
file:
- default: The default network for all services.
- mailpit: A local email testing service.
- frankenphp: A PHP server with Caddy.
- node: A Node.js development container.
- mysql: MySQL database server.
- postgres: PostgreSQL database server.
- adminer: Database management tool.
- mysql_data: Persistent storage for MySQL data.
- postgres_data: Persistent storage for PostgreSQL data.
Connect with me:
- GitHub: MarJC5
- LinkedIn: Jean-Christio Martin
- Twitter: @jeanchristio
This project is licensed under the MIT License.