A simple Docker-based container for PHP and Node.js projects that ensures files created inside the container match your host's UID/GID.
- Docker Engine & Docker Compose
- Git
- Linux or Windows WSL2
- Clone the repository
git clone https://github.com/ionghitun/projects.git cd projects
- Set ownership (avoid root!)
sudo chown -R $USER:$USER .
- Copy and configure environment variables
cp scripts/.env.example scripts/.env export USER_ID=$(id -u) export GROUP_ID=$(id -g) # Edit other variables in scripts/.env as needed
- PHP Configuration: Edit
scripts/php/php.ini
- Supervisor: Edit
scripts/php/supervisord.conf
- Global Run:
- Copy
scripts/run_all.sh.example
toscripts/run_all.sh
- Modify it to include paths to your other project directories
- Execute
./scripts/run_all.sh
to start multiple projects at once
- Copy
Note: Any files or folders created inside the container (e.g., via
composer create-project
ornpx create-react-app
) will have permissions matching your host UID/GID.
./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
- Permission Issues: Ensure
USER_ID
andGROUP_ID
inscripts/.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 versiondocker-compose
This project is licensed under the MIT License. See LICENSE for details.
Contributions are welcome! Please open issues or submit pull requests following the repository guidelines.
Happy Coding