-
Notifications
You must be signed in to change notification settings - Fork 74
/
Dockerfile.web
37 lines (34 loc) · 1.89 KB
/
Dockerfile.web
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# syntax=docker/dockerfile:1
FROM ocaml/opam:debian-12-ocaml-4.14@sha256:be38063c43f00b0627de62144f24dc8c9929504f0db4774343d7bffc62777073 AS build
RUN sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam && opam init --reinit -ni
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libgmp-dev libssl-dev libffi-dev libsqlite3-dev -y --no-install-recommends
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard 1b4da5019e5ea60af76c94aacc672a7e9659a832 && opam update
COPY --chown=opam \
ocurrent/current_rpc.opam \
/src/ocurrent/
COPY --chown=opam \
solver-service/solver-service.opam \
solver-service/solver-worker.opam \
solver-service/solver-service-api.opam \
/src/solver-service/
WORKDIR /src
RUN opam pin -yn add ./ocurrent
RUN opam pin -yn add ./solver-service
COPY --chown=opam ocaml-ci-api.opam ocaml-ci-web.opam ocaml-ci.opam /src/
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam config exec -- dune build ./_build/install/default/bin/ocaml-ci-web
FROM debian:12
RUN apt-get update && apt-get install libev4 libsqlite3-dev curl jq dumb-init -y --no-install-recommends
WORKDIR /
ENTRYPOINT ["dumb-init", "/usr/local/bin/ocaml-ci-web"]
RUN apt-get install ca-certificates -y # https://github.com/mirage/ocaml-conduit/issues/388
COPY --from=build /src/_build/install/default/bin/ocaml-ci-web /usr/local/bin/
## Load profile-pictures of registered organisations
RUN mkdir -p /profile-pictures/github
RUN mkdir -p /profile-pictures/gitlab
COPY --from=build /src/bin/add-profile-picture /usr/local/bin
COPY --from=build /src/deploy-data/github-organisations.txt /github-organisations.txt
COPY --from=build /src/deploy-data/gitlab-organisations.txt /gitlab-organisations.txt
RUN xargs -n 1 /usr/local/bin/add-profile-picture --github < /github-organisations.txt
RUN xargs -n 1 /usr/local/bin/add-profile-picture --gitlab < /gitlab-organisations.txt