-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 907 Bytes
/
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
## Dockerfile for "crypto-orderbook-db"
##
## This file builds an image containing all this project's executables.
##
## See Dockerfile's for individual executables under the subfolders
## inside "exe/".
FROM ubuntu:16.04 as builder
RUN apt-get update \
&& apt-get install -y curl libpq-dev libgmp10
RUN curl -sSL https://get.haskellstack.org/ | sh
# Pre-install deps so we can re-use cached layers
# https://github.com/freebroccolo/docker-haskell/issues/54#issuecomment-283222910
COPY stack.yaml ./
COPY package.yaml ./
RUN stack setup
RUN stack install --dependencies-only
COPY src ./src
COPY exe ./exe
# needed to embed git commit in executable
COPY .git ./.git
RUN stack build --test --copy-bins --local-bin-path /tmp/dist/
# RUNTIME
FROM ubuntu:16.04 as runtime
RUN apt-get update \
&& apt-get install -y ca-certificates libpq-dev libgmp10
COPY --from=builder /tmp/dist/* /usr/local/bin/