FROM node:12-alpine

# Hack to upgrade NPM:
#  - install local version
#  - replace old global verson with new one

RUN npm install npm@5.3 && \
    rm -rf /usr/local/lib/node_modules/npm && \
    mv /node_modules/npm  /usr/local/lib/node_modules

RUN npm install -g xo@0.24.0

RUN npm install -g eslint-plugin-html@6.0.0

# Cleanup
RUN rm -fr /root/.npm /node_modules

WORKDIR /src

ENTRYPOINT ["/usr/local/bin/xo"]
