Docker-based PHP containerized project execution environment.
This project allows you to manage multiple PHP projects easily using Docker. By specifying project paths via .env files and utilizing SSH services, you can seamlessly connect to your containers using VSCode's Remote-SSH.
- Multi-project support via isolated
.envfiles in theenvs/directory. - Easy SSH access to containers.
- Configurable services (MariaDB, Redis, Nginx, PHP, etc.).
- Automated user/group ID syncing for Linux environments.
Run the link script to create a default .env configuration template.
./linkEdit the generated .env file to match your project requirements. You can set the project name, ports, and enabled services.
Example .env Settings:
# Enabled services (space-separated)
SERVICES="mariadb redis"
APP_URL=http://127.0.0.1:1050
PROJECT=my-awesome-project
FOLDER=..
HTTP_PORT=1050
HTTPS_PORT=1150
DB_PORT=1250
SSH_PORT=2222
USER_ID=1000
GROUP_ID=1000Check the services/ directory for available services (e.g., mariadb, redis, drive). Enable them by adding them to the SERVICES variable in your .env.
Build the containers (required only once or when changing user/group IDs).
./console build| Command | Description |
|---|---|
./link |
Select or initialize an environment template. |
./link <project> |
Quickly link to a specific project in envs/. |
./start |
Start the current project containers. |
./stop |
Stop the current project containers. |
./restart |
Restart the current project containers. |
./reload |
Reload Nginx configuration without restarting. |
./info |
Display current .env information. |
./stats |
View running status of all projects in envs/. |
./artisan |
Run Laravel artisan commands in the PHP container. |
./console |
Main CLI for Docker operations and project management. |
./all # Check status of all projects in envs/
./all start # Start all projects in envs/
./all stop # Stop all projects in envs/The ./console script is the primary entry point. Running it without arguments will enter the PHP container workspace.
./console # Enter PHP workspace
./console exec db bash # Enter DB container
./console help # Show all subcommandsTo update only the core Bash scripts and get the latest fixes:
./update_bash.sh