FROM ocaml/opam:alpine as build # Install system dependencies RUN sudo apk add --update libev-dev openssl-dev gmp-dev gmp WORKDIR /home/opam # Install dependencies ADD wormhole.opam wormhole.opam RUN opam install . --deps-only --verbose # Build project ADD . . RUN opam exec -- dune build -j 1 FROM alpine:3.18.4 as run RUN apk add --update libev openssl gmp COPY --from=build /home/opam/_build/default/bin/main.exe /bin/app ENTRYPOINT /bin/app