Skip to content

Commit 7e7ccca

Browse files
author
Dominik Liebler
committed
build Sphinx documentation and use php -S to actually view it
1 parent 8dd3959 commit 7e7ccca

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ WORKDIR /app
33
RUN apt-get update \
44
&& apt-get install -y libzip-dev wget git-core python-pip \
55
&& docker-php-ext-install zip \
6-
&& pip install Sphinx
6+
&& pip install Sphinx sphinx_rtd_theme
77
ADD . /app
8-
CMD [ "make", "cs", "test" ]
8+
RUN cd /app && make cs test html
9+
CMD [ "php", "-S", "0.0.0.0:80", "-t", "_build/html" ]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ vendor: composer.phar
200200
php composer.phar install
201201

202202
cs: install
203-
./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor .
203+
./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor,_build .
204204

205-
test: install cs
205+
test: install
206206
./vendor/bin/phpunit

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ $ ./vendor/bin/phpunit
2929

3030
## using Docker (optional)
3131

32-
You can optionally run tests using [Docker for Mac, Windows or Linux](https://docs.docker.com/compose/install/).
32+
You can optionally build and browse the documentation using [Docker for Mac, Windows or Linux](https://docs.docker.com/compose/install/).
3333

3434
Just run:
3535

3636
```bash
3737
$ docker-compose up
3838
```
3939

40+
Go to [http://localhost:8080/README.html](http://localhost:8080/README.html) to read the generated documentation.
41+
4042
To only install the dependencies, use `docker-compose` like this:
4143

4244
```bash

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ services:
44
build:
55
context: .
66
dockerfile: Dockerfile
7+
ports:
8+
- "8080:80"
79
volumes:
810
- .:/app

0 commit comments

Comments
 (0)