Skip to content

Commit

Permalink
Switch to cpm for fetching, building and testing dependencies
Browse files Browse the repository at this point in the history
Change-Id: I2f94d92c2dac13b4c920d44d5285994e43e5638b
  • Loading branch information
Akron authored and kupietz committed Sep 9, 2024
1 parent 1b9c243 commit 1689140
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build assets in builder image
FROM node:20 as assetbuilder
FROM node:20 AS assetbuilder

WORKDIR '/app'

Expand All @@ -25,8 +25,8 @@ RUN cd /kalamar && \
rm package-lock.json \
dev/robots.txt

# Use alpine linux as base image
FROM alpine:latest as kalamar
# Use alpine linux AS base image
FROM alpine:latest AS kalamar

RUN apk update && \
apk add --no-cache git \
Expand All @@ -40,29 +40,28 @@ RUN apk update && \
libxml2 \
libxml2-dev \
unzip \
curl
curl && \
set -o pipefail

RUN curl -fsSL https://raw.githubusercontent.com/kupietz/cpm/main/cpm > /bin/cpm && chmod a+x /bin/cpm

RUN cpm install --test -g Cpanel::JSON::XS File::ShareDir::Install EV IO::Socket::Socks && \
cpm install --test -g "https://github.com/Akron/Mojolicious-Plugin-Localize/archive/refs/tags/v0.22.tar.gz" && \
cpm install --test -g "https://github.com/KorAP/KorAP-XML-TEI/archive/refs/tags/v2.5.0.tar.gz" && \
cpm install --test -g "https://github.com/KorAP/KorAP-XML-Krill/archive/refs/tags/v0.55.tar.gz" && \
cpm install --test -g "https://github.com/KorAP/KorAP-XML-CoNLL-U/archive/refs/tags/v0.6.3.tar.gz"

# Copy assets from former container
COPY --from=assetbuilder /kalamar /kalamar

WORKDIR /kalamar

RUN set -o pipefail && \
curl -L https://cpanmin.us | perl - App::cpanminus && \
cpanm https://github.com/Akron/Mojolicious-Plugin-Localize/archive/refs/tags/v0.22.tar.gz \
Cpanel::JSON::XS \
File::ShareDir::Install \
EV \
IO::Socket::Socks \
https://github.com/KorAP/KorAP-XML-TEI/archive/refs/tags/v2.5.0.tar.gz \
https://github.com/KorAP/KorAP-XML-Krill/archive/refs/tags/v0.55.tar.gz \
https://github.com/KorAP/KorAP-XML-CoNLL-U/archive/refs/tags/v0.6.3.tar.gz

# Install Kalamar including all dependencies
RUN cpanm --installdeps . -M https://cpan.metacpan.org
RUN cpm install --test -g

# Remove all build dependencies
RUN apk del git \
RUN rm /bin/cpm && \
apk del git \
perl-dev \
perl-doc \
g++ \
Expand Down

0 comments on commit 1689140

Please sign in to comment.