From 7e7cccab645c2923e40f490da21b9b4722cf47b2 Mon Sep 17 00:00:00 2001 From: Dominik Liebler Date: Mon, 25 Feb 2019 22:15:04 +0100 Subject: [PATCH] build Sphinx documentation and use php -S to actually view it --- Dockerfile | 5 +++-- Makefile | 4 ++-- README.md | 4 +++- docker-compose.yml | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index de87d01..c3f3b9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ WORKDIR /app RUN apt-get update \ && apt-get install -y libzip-dev wget git-core python-pip \ && docker-php-ext-install zip \ - && pip install Sphinx + && pip install Sphinx sphinx_rtd_theme ADD . /app -CMD [ "make", "cs", "test" ] +RUN cd /app && make cs test html +CMD [ "php", "-S", "0.0.0.0:80", "-t", "_build/html" ] diff --git a/Makefile b/Makefile index ff8edc0..560c62d 100644 --- a/Makefile +++ b/Makefile @@ -200,7 +200,7 @@ vendor: composer.phar php composer.phar install cs: install - ./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor . + ./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor,_build . -test: install cs +test: install ./vendor/bin/phpunit diff --git a/README.md b/README.md index 8899aa4..1b2da37 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ $ ./vendor/bin/phpunit ## using Docker (optional) -You can optionally run tests using [Docker for Mac, Windows or Linux](https://docs.docker.com/compose/install/). +You can optionally build and browse the documentation using [Docker for Mac, Windows or Linux](https://docs.docker.com/compose/install/). Just run: @@ -37,6 +37,8 @@ Just run: $ docker-compose up ``` +Go to [http://localhost:8080/README.html](http://localhost:8080/README.html) to read the generated documentation. + To only install the dependencies, use `docker-compose` like this: ```bash diff --git a/docker-compose.yml b/docker-compose.yml index af6b1cc..bd0338e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,5 +4,7 @@ services: build: context: . dockerfile: Dockerfile + ports: + - "8080:80" volumes: - .:/app