From e829a11c932835d52df563f9d1600d10900e755f Mon Sep 17 00:00:00 2001 From: Tim de Pater Date: Sun, 21 Jul 2019 08:20:03 +0200 Subject: [PATCH] Fixed #11; Make the document root a volume so that it can be mounted --- Dockerfile | 3 +++ README.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4d65d66..4a6ead3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,9 @@ RUN chown -R nobody.nobody /run && \ # Setup document root RUN mkdir -p /var/www/html +# Make the document root a volume +VOLUME /var/www/html + # Switch to use a non-root user from here on USER nobody diff --git a/README.md b/README.md index 2d11157..e834a67 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,7 @@ Start the Docker container: docker run -p 80:8080 trafex/alpine-nginx-php7 See the PHP info on http://localhost, or the static html page on http://localhost/test.html + +Or mount your own code to be served by PHP-FPM & Nginx + + docker run -p 80:8080 -v ~/my-codebase:/var/www/html trafex/alpine-nginx-php7