PHP built-in server
PHP has an built-in http server. Usage is very simple, from your app root run:
php -S localhost:8080
This suits my needs perfectly. Notice that the PHP manual warns that the server shouldn't be used on a public network, only for development. I like gray lines.
FROM php:7.1-cli COPY . /usr/src/app WORKDIR /usr/src/app EXPOSE 8080 CMD php -S 0.0.0.0:8080
I run the container like this:
docker run -d -e VIRTUAL_HOST=change_to_your_domain.com --name app_name image_name
The -e environmental variable is for my Nginx-proxy container that handles incoming requests and points them to the correct content. This way I can host multiple domains with one ip on DigitalOcean.
Find out more about Nginx-proxy: