#!/bin/sh

name=$([[ $1 ]] && echo $1 || echo "webserver")
mount=$([[ $2 ]] && echo $2 || echo "$HOME/projects/")

read -p "Port to use for the webserver (default = 8080) " port

if [[ $port == "" ]]; then
	port=8080
fi

echo "
=> Starting container with port $port
"

docker run --rm \
	-v $mount:/var/www/html \
    -p $port:8080
	--name $name \
	erseco/alpine-php-webserver
