forked from seanhess/hyperbole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (40 loc) · 1.29 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
FROM haskell:9.8.2 AS base
WORKDIR /opt/build
RUN cabal update
# skeletest network
RUN cabal install bytestring containers casing effectful text wai warp wai-websockets cookie string-conversions hpack
FROM haskell:9.8.2 AS dependencies
WORKDIR /opt/build
COPY --from=base /root/.cache /root/.cache
COPY --from=base /root/.local /root/.local
COPY --from=base /root/.config /root/.config
# RUN apt-get update && apt-get install -y libpcre3 libpcre3-dev libcurl4-openssl-dev cron vim rsyslog
ADD ./package.yaml .
ADD ./cabal.project .
RUN hpack
RUN cabal update
RUN cabal build --only-dependencies
FROM haskell:9.8.2 AS build
WORKDIR /opt/build
COPY --from=dependencies /root/.cache /root/.cache
COPY --from=dependencies /root/.local /root/.local
COPY --from=dependencies /root/.config /root/.config
ADD ./package.yaml .
ADD ./cabal.project .
ADD ./client ./client
ADD ./test ./test
ADD ./src ./src
ADD ./example ./example
ADD *.md .
ADD LICENSE .
RUN hpack
RUN cd example && hpack && cabal build examples
RUN mkdir bin
RUN cd example && export EXEC=$(cabal list-bin examples); cp $EXEC /opt/build/bin/examples
FROM debian:10 AS app
WORKDIR /opt/app
COPY --from=build /opt/build/bin/examples ./examples
ADD ./client ./client
ADD ./example/static ./static
# ENV DYNAMO_LOCAL=False
ENTRYPOINT ["/opt/app/examples"]