-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
40 lines (31 loc) · 987 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
36
37
38
39
FROM ocaml/opam:alpine_ocaml-4.04.2
# add the code
ADD src src
ADD test test
ADD utils utils
RUN sudo chown -R opam:nogroup src
RUN sudo chown -R opam:nogroup test
RUN sudo chown -R opam:nogroup utils
# add the build script
ADD build.sh .
# setup ocaml
RUN sudo apk update && sudo apk add alpine-sdk bash ncurses-dev m4 perl gmp-dev zlib-dev libsodium-dev opam zeromq-dev \
&& opam pin add -n sodium https://github.com/me-box/ocaml-sodium.git#with_auth_hmac256 \
&& opam install -y reason lwt tls sodium macaroons ezirmin bitstring ppx_bitstring uuidm lwt-zmq bos oml \
&& sudo chmod +x build.sh && sync \
&& ./build.sh \
&& rm -rf /home/opam/src \
&& rm -rf /home/opam/test \
&& rm -rf /home/opam/utils \
&& rm -rf /home/opam/.opam \
&& rm -rf /home/opam/opam-repository
FROM alpine:3.6
USER root
WORKDIR /app/zest/
COPY --from=0 /home/opam/ .
# runtime dependencies
RUN apk update && apk upgrade \
&& apk add libsodium gmp zlib libzmq
VOLUME /database
EXPOSE 5555
EXPOSE 5556