# Using alpine linux for small image
# - http://gliderlabs.viewdocs.io/docker-alpine/
FROM node:14.2-alpine
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]$"

# install system packages
RUN apk --no-cache add \
  nodejs \
 && npm install apidoc -g

ADD ./entrypoint-apidocs.sh /scripts/entrypoint.sh
RUN chmod +x -R /scripts && mkdir /src

ENTRYPOINT ["/scripts/entrypoint.sh"]
