Some Error handling and acceptance tests
This commit is contained in:
21
docker/Dockerfile-apidocs
Normal file
21
docker/Dockerfile-apidocs
Normal 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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
6
docker/entrypoint-apidocs.sh
Normal file
6
docker/entrypoint-apidocs.sh
Normal 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}
|
||||
1
docker/entrypoint-seeder.sh
Normal file
1
docker/entrypoint-seeder.sh
Normal file
@@ -0,0 +1 @@
|
||||
#!/usr/bin/env bash
|
||||
Reference in New Issue
Block a user