Simple docker image for Symfony development
- Built on the lightweight and secure Alpine Linux distribution
- Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
- Use runit instead of supervisor
- Very small Docker image size
- PHP 7.2
- PHP 7.4
- PHP 8.0
- PHP 8.1 (recommend usage)
- PHP 8.2 (todo)
- Build image
./build php7.2 # Build image with php 7.2
./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
- Build for Symfony 3 with PHP 7.4
docker build --no-cache -f php7.4.symfony-3.Dockerfile . -t pnlinh/symfony:3-php7.4
- Mount your code to be served with container
docker run --name=app -v /path/to/project:/var/www/html -p 80:80 pnlinh/symfony:php8.1
- With docker-compose
version: '3.4'
services:
app:
image: pnlinh/symfony:php8.1
hostname: symfony-app
container_name: symfony-app
ports:
- "80:80"
volumes:
- .:/var/www/html
networks:
- localnet
networks:
localnet:
driver: "bridge"
- Browser to: http://localhost