From 5bbd61d112b7cac1944a503e766030677d492c6b Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 31 Jan 2019 09:24:54 +0100 Subject: [PATCH] Added docker test setup --- README.md | 15 +++++++++++++-- docker/image/Dockerfile | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docker/image/Dockerfile diff --git a/README.md b/README.md index e70b77b..ec8efbc 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,19 @@ Do not forget to edit the basepath in .htaccess too if you are on Apache2. In or * Dont forget to set the correct basepath as argument in your run method and in your .htaccess file. * Enable mod_rewrite in your Apache2 settings -## Test setup -There is a little Vagrant test setup. Just run ```vagrant up``` to spin up a Apache2 Webserver on Ubuntu. Then navigate to http://router.local after adding the machine IP to your hosts file. +## Test setup with docker +I have created a little docker test setup. + +1. Build the image: docker build -t simplephprouter docker/image + +2. Spin up a container + * On Linux / Mac or Windows Powershell use: ```docker run -d -p 80:80 -v $(pwd):/var/www/html --name simplephprouter simplephprouter``` + * On Windows CMD use ```docker run -d -p 80:80 -v %cd%:/var/www/html --name simplephprouter simplephprouter``` + +3. Open your browser and navigate to http://localhost + +## Test setup with vagrant (not longer maintained) +There is a little Vagrant test setup. Just run ```vagrant up``` to spin up a Apache2 Webserver on Ubuntu. Then navigate to http://router.local after adding the machine IP to your hosts file. This test setup is not longer maintained and will probably break in future. Use the docker test setup instead. ## Todo * Create demo configuration for nginx diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile new file mode 100644 index 0000000..fe78a2f --- /dev/null +++ b/docker/image/Dockerfile @@ -0,0 +1,3 @@ +FROM php:7.2-apache + +RUN a2enmod rewrite