]> Git — Sourcephile - gargantext.git/blob - devops/docker/Dockerfile
Update CI and docker image
[gargantext.git] / devops / docker / Dockerfile
1 FROM ubuntu:jammy
2
3 ARG DEBIAN_FRONTEND=noninteractive
4 ARG GHC=8.10.7
5 ARG STACK=2.7.3
6 ARG CABAL=3.10.1.0
7 COPY ./shell.nix /builds/gargantext/shell.nix
8 COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix
9 COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix
10 COPY ./nix/overlays/Cabal-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-3.10.1.0.nix
11 COPY ./nix/overlays/cabal-install-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-3.10.1.0.nix
12 COPY ./nix/overlays/cabal-install-solver-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-solver-3.10.1.0.nix
13 COPY ./nix/overlays/Cabal-syntax-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-syntax-3.10.1.0.nix
14 COPY ./nix/overlays/directory-1.3.7.0.nix /builds/gargantext/nix/overlays/directory-1.3.7.0.nix
15 COPY ./nix/overlays/hackage-security-0.6.2.3.nix /builds/gargantext/nix/overlays/hackage-security-0.6.2.3.nix
16 COPY ./nix/overlays/process-1.6.15.0.nix /builds/gargantext/nix/overlays/process-1.6.15.0.nix
17
18 ENV TZ=Europe/Rome
19 RUN apt-get update && \
20 apt-get install --no-install-recommends -y \
21 apt-transport-https \
22 autoconf \
23 automake \
24 build-essential \
25 ca-certificates \
26 curl \
27 gcc \
28 git \
29 gnupg2 \
30 libffi-dev \
31 libffi7 \
32 libgmp-dev \
33 libgmp10 \
34 libncurses-dev \
35 libncurses5 \
36 libnuma-dev \
37 libtinfo5 \
38 locales \
39 lsb-release \
40 software-properties-common \
41 strace \
42 sudo \
43 wget \
44 vim \
45 xz-utils \
46 zlib1g-dev && \
47 apt-get clean && rm -rf /var/lib/apt/lists/* && \
48 mkdir -m 0755 /nix && groupadd -r nixbld && chown root /nix && \
49 for n in $(seq 1 10); do useradd -c "Nix build user $n" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(command -v nologin)" "nixbld$n"; done
50
51 RUN gpg --batch --keyserver keys.openpgp.org --recv-keys 7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C && \
52 gpg --batch --keyserver keyserver.ubuntu.com --recv-keys FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01
53 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
54
55 RUN set -o pipefail && \
56 bash <(curl -L https://releases.nixos.org/nix/nix-2.15.0/install) --no-daemon && \
57 locale-gen en_US.UTF-8 && chown root -R /nix
58
59 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
60 ENV USER=root
61 ENV SHELL /bin/bash
62 RUN . "$HOME/.nix-profile/etc/profile.d/nix.sh" && \
63 mkdir -p "/builds/gargantext/" && chmod 777 -R "/builds/gargantext" && \
64 echo "source $HOME/.nix-profile/etc/profile.d/nix.sh" >> "$HOME/.bashrc" && \
65 echo `which nix-env`
66
67 ENV PATH=/root/.nix-profile/bin:$PATH
68
69 RUN . $HOME/.bashrc && nix-env --version
70
71 ENV PATH=/root/.local/bin:$PATH
72
73 RUN cd /builds/gargantext && nix-shell
74 WORKDIR "/builds/gargantext/"