Last active
September 16, 2018 04:19
-
-
Save abiusx/8a07aa28048bfa9a16df93a1c5e8fabd to your computer and use it in GitHub Desktop.
Quick PHP-Apache Docker environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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