Sign inSign up

e98cuenc/nginx-php-fpm

By e98cuenc

•Updated over 8 years ago

Alpine linux with PHP, Nginx, memcache and mariadb, all under 80MB

Image
0

5.7K

e98cuenc/nginx-php-fpm repository overview

⁠Docker: nginx + php-fpm

Docker Nginx & PHP-FPM image built on Alpine Linux micro OS with the final image size of 32 MB vs. 100+ MB compared to the Ubuntu / Debian equivalent. It's intended to be used as a base image for building final app images ready for deployment, but can be used as is and configured via volumes.

⁠Running

Pull or build the image yourself and run it. Before you do that you'll need to configure Nginx and have the application ready for "dockerisation". Both can be passed using mounted volumes or baked right into the image during the build.

# Build
docker build -t e98cuenc/nginx-php-fpm .

# Or pull
docker pull e98cuenc/nginx-php-fpm

# Run
docker run -d -p 80:80 -p 443:443 --name nginx-php-fpm e98cuenc/nginx-php-fpm

# Run with a mounted volume
docker run -d -p 80:80 -p 443:443 -v $PATH:/var/www --name nginx-php-fpm e98cuenc/nginx-php-fpm

⁠Bonus

# Connect to an existing container.
docker exec -ti nginx-php-fpm sh
 
# Remove exited containers.
docker ps -a | grep 'Exited' | awk '{print $1}' | xargs docker rm
 
# Remove intermediary and unused images.
docker rmi $(docker images -aq -f "dangling=true")

Tag summary

Content type

Image

Digest

Size

224.6 MB

Last updated

over 8 years ago

docker pull e98cuenc/nginx-php-fpm