2023-05-16 01:41:19 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2024-01-26 16:07:28 +01:00
|
|
|
FROM ocaml/opam:alpine-3.19-ocaml-5.1 AS builder
|
2023-05-16 01:41:19 +02:00
|
|
|
WORKDIR /usr/src/pusk
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
USER root
|
2023-05-16 02:04:12 +02:00
|
|
|
RUN apk update && \
|
|
|
|
apk add gmp-dev pcre-dev openssl-dev && \
|
2023-05-16 01:41:19 +02:00
|
|
|
chown -R opam:opam .
|
|
|
|
|
|
|
|
USER opam
|
2023-05-16 02:04:12 +02:00
|
|
|
RUN opam install -y dune cohttp-lwt-unix dotenv twostep lwt_ssl yojson core && \
|
2023-05-16 01:41:19 +02:00
|
|
|
eval $(opam env) && \
|
2023-05-16 02:04:12 +02:00
|
|
|
dune build --profile=release
|
2023-05-16 01:41:19 +02:00
|
|
|
|
2023-05-16 02:04:12 +02:00
|
|
|
FROM alpine:3.18
|
2023-05-16 01:41:19 +02:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-05-16 02:04:12 +02:00
|
|
|
RUN apk update && \
|
|
|
|
apk add dumb-init firefox libc6-compat pcre-dev && \
|
|
|
|
rm -rf /var/cache/apk/*
|
2023-05-16 01:41:19 +02:00
|
|
|
|
2023-05-16 02:11:13 +02:00
|
|
|
COPY --from=builder /usr/src/pusk/_build/default/bin/main.exe /app/pusk
|
2024-07-11 09:25:48 +02:00
|
|
|
COPY --from=builder /usr/src/pusk/LICENSE /app/pusk
|
2023-05-16 01:41:19 +02:00
|
|
|
|
|
|
|
CMD ["dumb-init", "./pusk"]
|