-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathDockerfile.web
58 lines (55 loc) · 2.62 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# syntax=docker/dockerfile:1
FROM ocaml/opam:debian-12-ocaml-4.14@sha256:6246731ea5d2cd3a57669027aae33184d30d424e41ff8219d05a214726ef7426 AS build
RUN sudo ln -sf /usr/bin/opam-2.3 /usr/bin/opam && opam init --reinit -ni
RUN sudo rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' | sudo tee /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt update && sudo apt-get --no-install-recommends install -y \
capnproto \
libev-dev \
libffi-dev \
libgmp-dev \
libsqlite3-dev \
libssl-dev \
m4 \
pkg-config
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard 11bdbee61114a1cfa080b764e71c72a5760a93f0 && opam update
COPY --chown=opam --link \
ocurrent/current_rpc.opam \
/src/ocurrent/
COPY --chown=opam --link \
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 --link ocaml-ci-api.opam ocaml-ci-web.opam ocaml-ci.opam /src/
RUN --mount=type=cache,target=/home/opam/.opam/download-cache,sharing=locked,uid=1000,gid=1000 \
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 rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
# ca-certificates: https://github.com/mirage/ocaml-conduit/issues/388
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get --no-install-recommends install -y \
ca-certificates \
curl \
dumb-init \
jq \
libev4 \
libsqlite3-dev
WORKDIR /
ENTRYPOINT ["dumb-init", "/usr/local/bin/ocaml-ci-web"]
COPY --from=build --link /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 --link /src/bin/add-profile-picture /usr/local/bin
COPY --from=build --link /src/deploy-data/github-organisations.txt /github-organisations.txt
COPY --from=build --link /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