FROM alpine:3.11 AS builder RUN apk add --no-cache npm g++ WORKDIR /webserver # Get a word list for the abbrgen module RUN wget 'http://app.aspell.net/create?max_size=60&spelling=GBs&max_variant=0&diacritic=strip&special=hacker&download=wordlist&encoding=utf-8&format=inline' -O words && \ printf "1,/---/ d\nw\nq\n" | ed words >/dev/null COPY . . # The --unsafe-perm flag is to allow building the abbreviation_gen executable RUN npm install --unsafe-perm ##### FROM alpine:3.11 AS runner RUN apk add --no-cache nodejs WORKDIR /webserver COPY --from=builder /webserver /webserver # Move the word list to where abbreviation_gen expects it RUN mkdir -p /usr/share/dict && \ mv /webserver/words /usr/share/dict/words ENTRYPOINT ["./webserver.js"]