summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 3ac1a0c8d1f2f68b19eeb24937605e0115ade8bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM alpine:3.12 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 - | sed '1,/---/d' >words

COPY . .
# The --unsafe-perm flag is to allow building the abbreviation_gen executable
RUN npm install --unsafe-perm


#####

FROM alpine:3.11 AS runner

# texlive: for pdfjam for pdfrotate
# git: for blog
RUN apk add --no-cache nodejs texlive git

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"]