pusk/Dockerfile

27 lines
591 B
Text
Raw Normal View History

2023-05-16 01:41:19 +02:00
# syntax=docker/dockerfile:1
2024-07-11 12:19:52 +02:00
FROM ocaml/opam:alpine-3.20-ocaml-5.2 AS builder
2023-05-16 01:41:19 +02:00
WORKDIR /usr/src/pusk
COPY . .
USER root
2024-07-11 12:19:52 +02:00
RUN 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
2024-07-11 12:19:52 +02:00
FROM alpine:3.20
2023-05-16 01:41:19 +02:00
WORKDIR /app
2024-07-11 12:19:52 +02:00
RUN apk add --no-cache \
dumb-init firefox libc6-compat pcre-dev
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"]