From 5e90287fbe4ed269115510db7e5b7e2e92a9819b Mon Sep 17 00:00:00 2001 From: Tristan Rivoallan Date: Fri, 8 Dec 2017 17:58:22 +0100 Subject: [PATCH] Added Docker and docker-compose for easy development and testing --- Dockerfile | 7 +++++++ README.md | 11 +++++++++++ docker-compose.yml | 13 +++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..baf1bdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +ARG OPCACHE_DASHBOARD_PHP_VERSION=7.2 + +FROM php:$OPCACHE_DASHBOARD_PHP_VERSION-apache + +COPY opcache.php /var/www/html/opcache.php + +RUN docker-php-ext-install opcache diff --git a/README.md b/README.md index d5a8a72..b31abee 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ Or just copy and paste ```opcache.php``` anywhere in your public folder. You can **Try to keep it safe for non authorized users.** +Development +=========== + +Run `docker-compose up` in project root directory. OPcache dashboard is available at http://localhost:8000/opcache.php + +Start coding :) + +The docker container configuration can be altered at build time using the following environment variables : + +- `OPCACHE_DASHBOARD_PHP_VERSION` : PHP version to be installed in the container. Supported versions are listed on [PHP's Docker image page](https://store.docker.com/images/php) (`*-apache` images are supported) + Screenshots =========== ![Main page](https://raw.github.com/carlosbuenosvinos/opcache-dashboard/master/thumbnail-1.png) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8942cff --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + web: + build: + context: . + args: + OPCACHE_DASHBOARD_PHP_VERSION: ${OPCACHE_DASHBOARD_PHP_VERSION-7.2} + image: opcache:php-${OPCACHE_DASHBOARD_PHP_VERSION-7.2} + volumes: + - ./opcache.php:/var/www/html/opcache.php + ports: + - ${OPCACHE_DASHBOARD_PORT-8000}:80