pusk/Dockerfile

28 lines
592 B
Text
Raw Normal View History

2023-05-16 01:41:19 +02:00
# syntax=docker/dockerfile:1
2023-05-16 02:04:12 +02:00
FROM ocaml/opam:alpine-3.18-ocaml-4.14 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
2023-05-16 01:41:19 +02:00
CMD ["dumb-init", "./pusk"]