From 0d95d0767386880b15d6dde32ab7aeb509fb7fa7 Mon Sep 17 00:00:00 2001 From: Joel Kemp Date: Sun, 18 Jan 2015 23:13:11 -0500 Subject: [PATCH] Docker support Fixes #27 Closes gh-30 --- Dockerfile | 1 + README.md | 23 ++++++++++++++++------- docker-bootstrap.sh | 3 +++ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 Dockerfile create mode 100755 docker-bootstrap.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..280c846 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM eboraas/apache-php \ No newline at end of file diff --git a/README.md b/README.md index 25379de..ed5f82c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,22 @@ This has, of course, crippled the tool a bit – as you can't run code that has ### Running it locally +#### Vagrant + +If you use vagrant, you can `vagrant up` within the phpepl root. This will spawn a virtual machine serving phpepl +at the `http://phpepl.dev` address. + +You can also do `vagrant plugin install vagrant-hostsupdater` if you need to fetch the hostname from `/etc/hosts` or another host file. + +#### Docker + +If you use Docker, you can run `./docker-bootstrap` to start a container that serves the app using PHP5 and Apache. + +To view the served app, visit the IP address of the host. Note, if you're using boot2docker, you need to visit the ip +found via the `boot2dock ip` command. + +#### Manually + To serve this application locally, you'll need any php-capable web server: * Mac: [MAMP](http://www.mamp.info/en/index.html) @@ -35,13 +51,6 @@ You can then point your web server to serve files from the `phpepl/` root folder You'll then have free reign to execute any commands. -#### Vagrant - -If you use vagrant, you can `vagrant up` within the phpepl root. This will spawn a virtual machine serving phpepl -at the `http://phpepl.dev` address. - -You can also do `vagrant plugin install vagrant-hostsupdater` if you need to fetch the hostname from `/etc/hosts` or another host file. - ### Contact Me If you hit any errors or if someone hacked the repl and it goes down, give diff --git a/docker-bootstrap.sh b/docker-bootstrap.sh new file mode 100755 index 0000000..26bd6c5 --- /dev/null +++ b/docker-bootstrap.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -p 80:80 -v $(pwd):/var/www/ -d eboraas/apache-php \ No newline at end of file