forked from Consensys/constellation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (25 loc) · 1.15 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
FROM ubuntu:xenial as builder
RUN apt-get update
RUN apt-get --no-install-recommends install -y apt-utils ca-certificates curl && \
curl -sSL https://get.haskellstack.org/ | sh
RUN apt-get --no-install-recommends install -y libgmp-dev libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev && \
apt-get --no-install-recommends install -y ruby ruby-dev build-essential && \
gem install --no-ri --no-rdoc fpm
ENV SRC /usr/local/src/constellation
WORKDIR $SRC
ADD stack.yaml $SRC/
RUN stack setup
ADD LICENSE constellation.cabal $SRC/
RUN stack build --dependencies-only
ADD README.md CHANGELOG.md Setup.hs $SRC/
COPY bin/ $SRC/bin/
COPY test/ $SRC/test/
COPY Constellation/ $SRC/Constellation/
RUN stack install --local-bin-path /usr/local/bin --test
# Pull binary into a second stage and deploy to container
FROM ubuntu:xenial
RUN mkdir -p /constellation
RUN apt-get update
RUN apt-get --no-install-recommends install -y apt-utils ca-certificates libgmp-dev libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev build-essential curl
COPY --from=builder /usr/local/bin/constellation-node /usr/local/bin/
ENTRYPOINT ["constellation-node"]