| # Build assets in builder image |
| FROM node:12 as assetbuilder |
| # This follows the "multi-stage build" pattern |
| RUN npm install -g sass && \ |
| # Copy repository respecting .dockerignore |
| # Use alpine linux as base image |
| # Copy assets from former container |
| COPY --from=assetbuilder /kalamar /kalamar |
| curl -L https://cpanmin.us | perl - App::cpanminus && \ |
| cpanm git://github.com/Akron/Mojolicious-Plugin-Localize.git \ |
| git://github.com/Akron/Mojolicious-Plugin-TagHelpers-ContentBlock.git && \ |
| cpanm --installdeps . -M https://cpan.metacpan.org |
| # Remove all build dependencies |
| /usr/local/share/man && \ |
| RUN addgroup -S korap && \ |
| adduser -S kalamar -G korap && \ |
| chown -R kalamar.korap /kalamar |
| ENV MOJO_LISTEN http://*:${MOJO_PORT} |
| ENTRYPOINT [ "perl", "script/kalamar" ] |
| LABEL maintainer="korap@ids-mannheim.de" |
| LABEL description="Docker Image for Kalamar, the KorAP user frontend" |
| LABEL repository="https://github.com/KorAP/Kalamar" |