Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!dune
!dune-project
!dune.lock
!sandworm.opam
!bin/
!lib/
Expand Down
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM ocaml/opam:alpine-3.20-ocaml-5.2 AS build
FROM alpine:3.22 AS build

RUN sudo apk update && \
sudo apk add curl git curl-dev libev-dev openssl-dev gmp-dev && \
sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam && opam init --reinit -ni && \
opam update -y
RUN apk update && \
apk add curl git curl-dev libev-dev openssl-dev gmp-dev musl-dev linux-headers make ocaml

WORKDIR /home/opam
COPY sandworm.opam sandworm.opam
RUN opam install . --deps-only -y
COPY --chown=opam:opam . .
RUN opam exec -- dune build --release
RUN git clone --depth=1 https://github.com/ocaml/dune.git && \
cd dune && \
./configure --prefix=/usr && \
make release && \
make install && \
cd .. && \
rm -r dune
COPY . .
RUN dune build --release

FROM alpine:3.20 AS run
FROM alpine:3.22 AS run
RUN apk update && apk add --update libev gmp git
WORKDIR /app
COPY --from=build /home/opam/static static
Expand Down