Some Error handling and acceptance tests

This commit is contained in:
Richard Morgan
2017-05-15 08:56:10 -04:00
parent 42dc785735
commit 2c8c692890
21 changed files with 457 additions and 126 deletions

21
docker/Dockerfile-apidocs Normal file
View File

@@ -0,0 +1,21 @@
# Using alpine linux for small image
# - http://gliderlabs.viewdocs.io/docker-alpine/
FROM alpine:3.4
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>
LABEL version=1.0 \
"usage"="docker run --rm --name apidocker -v <source dir>:/src -it apidocker" \
"env"="DOCS_DIR, APP_DIR, FILE_FILTER"
ENV DOCS_DIR="build/docs/" \
APP_DIR="app/" \
FILE_FILTER=".[php]$"
ADD ./docker/entrypoint-apidocs.sh /scripts/entrypoint.sh
# install system packages
RUN apk --no-cache add \
nodejs \
&& npm install apidoc -g \
&& chmod +x -R /scripts
ENTRYPOINT /scripts/entrypoint.sh

View File

@@ -1,11 +1,5 @@
#!/usr/bin/env bash
# start required services
#service ssh start
#service php5-fpm start
# keep the container running
#tail -f /dev/null
#tail -f /var/www/storage/logs/lumen.log
/usr/sbin/php-fpm7.0 -F

View File

@@ -9,6 +9,10 @@ server {
try_files $uri /index.php?$args;
}
location /docs {
try_files $uri /docs/index.html;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env sh
cd /src/
echo ${APP_DIR} : ${DOCS_DIR} : ${FILE_FILTER}
rm -rf ${DOCS_DIR} && mkdir -p ${DOCS_DIR}
apidoc -i ${APP_DIR} -o ${DOCS_DIR} -f ${FILE_FILTER}

View File

@@ -0,0 +1 @@
#!/usr/bin/env bash