-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (65 loc) · 2.14 KB
/
Dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM docker.io/library/haskell@sha256:a81f289e6ae9beaf53d81a9872b0906c2db2ef48298f6aeb83e2d52e356a5b81 AS builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
hunspell \
hunspell-cs \
hunspell-de-de \
hunspell-en-gb \
hunspell-en-us \
hunspell-es \
hunspell-fr \
hunspell-nl \
jq \
libpcre3-dev \
myspell-et \
&& \
rm -rf /var/lib/apt/lists/*
RUN useradd x -m && \
mkdir /home/x/r && \
chown -R x:x /home/x
#-------------------------------------------------------------------------------
USER x
WORKDIR /home/x/r
COPY --chown=x:x *.cabal cabal.project.freeze ./
RUN cabal update && \
cabal build --only-dependencies --enable-tests
COPY --chown=x:x . .
ARG GIT_DESCRIBE
RUN VERSION=$(echo "$GIT_DESCRIBE" | sed 's/-/./') && \
sed -i -E "s/(version: *)0.0.0/\1$VERSION/" ./*.cabal && \
cabal install -O2
#-------------------------------------------------------------------------------
ENV PATH=/home/x/r/bin:/home/x/.cabal/bin:$PATH \
LANG=C.UTF-8
CMD ["run"]
EXPOSE 80
HEALTHCHECK CMD curl -fs http://localhost || false
#===============================================================================
FROM docker.io/library/debian@sha256:fb9654aac57319592f1d51497c62001e7033eddf059355408a0b53f7c71f8d5f
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
hunspell \
hunspell-cs \
hunspell-de-de \
hunspell-en-gb \
hunspell-en-us \
hunspell-es \
hunspell-fr \
hunspell-nl \
myspell-et \
&& \
rm -rf /var/lib/apt/lists/*
RUN useradd x -m && \
mkdir /home/x/bin && \
chown -R x:x /home/x
#-------------------------------------------------------------------------------
COPY --from=builder /home/x/.cabal/bin/* /home/x/bin/
#-------------------------------------------------------------------------------
USER x
WORKDIR /home/x
ENV PATH=/home/x/bin:$PATH \
LANG=C.UTF-8
CMD ["isoxya-plugin-spellchecker", "-b", "0.0.0.0", "-p", "80"]
EXPOSE 80
HEALTHCHECK CMD curl -fs http://localhost || false