Sign inSign up

petronetto/php-nginx

By petronetto

Updated over 7 years ago

A very lightweight container to PHP Development.

Image
2

429

petronetto/php-nginx repository overview

A very lightweight container to PHP/Laravel Development

This container is based on phusion/baseimage-docker, that is a minimal Ubuntu base image modified for Docker-friendliness. Baseimage-docker only consumes 6 MB RAM and is much powerful than Busybox or Alpine.

This image contains:

Docker Setup

Usage

Start the container:

# From your project folder
docker run -p 8080:80 --name php \
           -v $(pwd):/var/www/src \
           -w /var/www/src \
           -d petronetto/php-nginx

If you need run some command through composer you may use:

# Creating a Larvel project from container
docker run -it --rm \
           -v $(pwd):/var/www/src \
           -w /var/www/src \
           petronetto/php-nginx \
           composer create-project laravel/laravel .

In PHP installation, see the PHP info on http://localhost:8080, or the static html page on http://localhost:8080/test.html

NOTE: If you're not running Docker Mac/Windows (which run Docker in a small virtualized layer), you may need to set permissions on the shared directories that Laravel needs to write to. The following will let Laravel write the storage and bootstrap directories:

# From your project folder
sudo chmod -R o+rw $(pwd)/bootstrap $(pwd)/storage

Maybe you also need change the project ownership if you using the container to create the new projects:

# From your project folder
sudo chown -R $(whoami) $(pwd)

Tag summary

Content type

Image

Digest

Size

43.5 MB

Last updated

over 7 years ago

docker pull petronetto/php-nginx