build Sphinx documentation and use php -S to actually view it

This commit is contained in:
Dominik Liebler
2019-02-25 22:15:04 +01:00
parent 8dd39599e7
commit 7e7cccab64
4 changed files with 10 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ WORKDIR /app
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y libzip-dev wget git-core python-pip \ && apt-get install -y libzip-dev wget git-core python-pip \
&& docker-php-ext-install zip \ && docker-php-ext-install zip \
&& pip install Sphinx && pip install Sphinx sphinx_rtd_theme
ADD . /app ADD . /app
CMD [ "make", "cs", "test" ] RUN cd /app && make cs test html
CMD [ "php", "-S", "0.0.0.0:80", "-t", "_build/html" ]

View File

@@ -200,7 +200,7 @@ vendor: composer.phar
php composer.phar install php composer.phar install
cs: 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 ./vendor/bin/phpunit

View File

@@ -29,7 +29,7 @@ $ ./vendor/bin/phpunit
## using Docker (optional) ## 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: Just run:
@@ -37,6 +37,8 @@ Just run:
$ docker-compose up $ 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: To only install the dependencies, use `docker-compose` like this:
```bash ```bash

View File

@@ -4,5 +4,7 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
ports:
- "8080:80"
volumes: volumes:
- .:/app - .:/app