Simple docker image for PHP/Laravel development
- Magento: https://github.com/pnlinh/docker-php/tree/feature/magento
- Symfony: https://github.com/pnlinh/docker-php/tree/feature/symfony
- Build image
./build php7.2 # Build image with php 7.4
./build php7.4 # Build image with php 7.4
./build php8.0 # Build image with php 8.0
./build php8.1 # Build image with php 8.1
- Mount your code to be served with container
docker run --name=app -v /path/to/project:/var/www/html -p 80:80 pnlinh/laravel:php8.1
- With docker-compose
version: '3.4'
services:
app:
image: pnlinh/laravel:php8.1
hostname: laravel-app
container_name: laravel-app
ports:
- "80:80"
volumes:
- .:/var/www/html
networks:
- localnet
networks:
localnet:
driver: "bridge"
- Browser to: http://localhost