This package provides an easy way to quickly set up php development server with docker. The advantage is you can use multiple project with the same setup.
The current package requirements are:
- Docker engine
- Docker compose
- nginx
- php8.1
- php7.4
- mariadb:latest
You can install your required version easily.
- Create src directory.
- In the src directory create your project directory
- In nginx conf.d create virtual domain
- All projects will be at
/var/wwwdirectory in nginx container docker compose up -d- After adding config.d edit host file
- In order to point all your virtual domain to host use *localhost
docker exec -it -w /var/www/project_id php8.1-container-name pwd
env GID=$(id -g) UID=$(id -u) docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g)
env GID=$(id -g) UID=$(id -u) docker-compose up -d
DB_CONNECTION=mysql
DB_HOST="mysql_db"
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=root
DB_PASSWORD=root