https://github.com/ionghitun/projects
A simple Docker-based container for PHP and Node.js projects that ensures files created inside the container match your host's UID/GID.
https://github.com/ionghitun/projects
docker node node-js nodejs php php-docker php-fpm wsl wsl2
Last synced: 3 months ago
JSON representation
A simple Docker-based container for PHP and Node.js projects that ensures files created inside the container match your host's UID/GID.
- Host: GitHub
- URL: https://github.com/ionghitun/projects
- Owner: ionghitun
- License: mit
- Created: 2021-02-14T12:57:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2026-03-21T17:05:05.000Z (3 months ago)
- Last Synced: 2026-03-22T07:11:48.548Z (3 months ago)
- Topics: docker, node, node-js, nodejs, php, php-docker, php-fpm, wsl, wsl2
- Language: Shell
- Homepage:
- Size: 38.1 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker PHP & Node Development Environment
A simple Docker-based container for PHP and Node.js projects that ensures files created inside the container match your host's UID/GID.
## Prerequisites
- Docker Engine & Docker Compose
- Git
- Linux or Windows WSL2
## Installation
1. **Clone the repository**
```bash
git clone https://github.com/ionghitun/projects.git
cd projects
```
2. **Set ownership (avoid root!)**
```bash
sudo chown -R $USER:$USER .
```
3. **Copy and configure environment variables**
```bash
cp scripts/.env.example scripts/.env
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
# Edit other variables in scripts/.env as needed
```
## Configuration
- **PHP Configuration**: Edit `scripts/php/php.ini`
- **Supervisor**: Edit `scripts/php/supervisord.conf`
- **Global Run**:
1. Copy `scripts/run_all.sh.example` to `scripts/run_all.sh`
2. Modify it to include paths to your other project directories
3. Execute `./scripts/run_all.sh` to start multiple projects at once
> **Note:** Any files or folders created inside the container (e.g., via `composer create-project` or `npx create-react-app`) will have permissions matching your host UID/GID.
## Available scripts
```bash
./scripts/start.sh # Start the container
./scripts/down.sh # Stop the container
./scripts/build.sh # Build or rebuild the container
./scripts/restart.sh # Restart the container
./scripts/console.sh # Open a shell into the container
```
## Configure everything at once, including my other repos
- run `sh scripts/configure.sh`
## Troubleshooting
- **Permission Issues**: Ensure `USER_ID` and `GROUP_ID` in `scripts/.env` match your host user IDs.
- **Docker Issues**: For older versions you might want to remove `COMPOSE_BAKE` from `.env`.
- **Docker Compose Issues**: Please update and ensure you can use `docker compose`, not old version `docker-compose`
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
## Contributing
Contributions are welcome! Please open issues or submit pull requests following the repository guidelines.
_Happy Coding_