Skip to content

Instantly share code, notes, and snippets.

@abiusx
Last active September 16, 2018 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abiusx/8a07aa28048bfa9a16df93a1c5e8fabd to your computer and use it in GitHub Desktop.
Save abiusx/8a07aa28048bfa9a16df93a1c5e8fabd to your computer and use it in GitHub Desktop.
Quick PHP-Apache Docker environment
#!/bin/sh
if [[ $# -lt 1 ]]; then
echo "Usage: $0 NAME [PORT]";
exit 1
fi
NAME=$1
PORT=${2:-80}
if [ "${PWD##*/}" != "${NAME}" ]; then
mkdir -p "${NAME}"
cd "${NAME}"
fi
docker run --name "${NAME}" -d -p ${PORT}:80 -v `pwd`:/var/www/html php:7.0-apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment