forked from data61/mirza-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbusinessRegistry.Dockerfile
36 lines (31 loc) · 1.3 KB
/
businessRegistry.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 alpine:3.8
WORKDIR /usr/src
RUN apk --no-cache add \
alpine-sdk \
git \
gmp-dev \
zlib-dev \
libpq \
linux-headers \
curl \
postgresql-dev \
ca-certificates \
ghc \
xz-dev \
upx
RUN curl -sSL https://get.haskellstack.org/ | sh && chmod 755 /usr/local/bin/stack
RUN /usr/local/bin/stack --version
RUN /usr/local/bin/stack --system-ghc update 2>&1
ADD stack.yaml Mirza.cabal run_tests.sh LICENSE README.md /usr/src/
ADD src/ /usr/src/src/
ADD test/ /usr/src/test/
ADD app/ /usr/src/app/
RUN mkdir /usr/src/dist/
RUN /usr/local/bin/stack --system-ghc setup 2>&1
RUN /usr/local/bin/stack --system-ghc install --split-objs --ghc-options='-fPIC' --only-dependencies 2>&1 || /usr/local/bin/stack --system-ghc install --split-objs --ghc-options='-fPIC' --only-dependencies 2>&1 || /usr/local/bin/stack --system-ghc install --split-objs --ghc-options='-fPIC' --only-dependencies 2>&1
RUN /usr/local/bin/stack --system-ghc install --split-objs --ghc-options='-fPIC' 2>&1
RUN ls -lah /usr/src/dist/businessRegistry && upx /usr/src/dist/businessRegistry && ls -lah /usr/src/dist/businessRegistry
FROM alpine:3.8
COPY --from=0 /usr/src/dist/businessRegistry /usr/bin/businessRegistry
RUN apk --no-cache add libpq gmp libffi libstdc++ xz-dev
RUN ls -lh /usr/bin/businessRegistry && /usr/bin/businessRegistry --help