]> Git — Sourcephile - gargantext.git/blob - devops/docker/Dockerfile
[MERGE] Phylo
[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
11 ENV TZ=Europe/Rome
12 RUN apt-get update && \
13 apt-get install --no-install-recommends -y \
14 apt-transport-https \
15 autoconf \
16 automake \
17 build-essential \
18 ca-certificates \
19 curl \
20 gcc \
21 git \
22 gnupg2 \
23 libffi-dev \
24 libffi7 \
25 libgmp-dev \
26 libgmp10 \
27 libncurses-dev \
28 libncurses5 \
29 libnuma-dev \
30 libtinfo5 \
31 locales \
32 lsb-release \
33 software-properties-common \
34 strace \
35 sudo \
36 wget \
37 vim \
38 xz-utils \
39 zlib1g-dev && \
40 apt-get clean && rm -rf /var/lib/apt/lists/* && \
41 mkdir -m 0755 /nix && groupadd -r nixbld && chown root /nix && \
42 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
43
44 RUN gpg --batch --keyserver keys.openpgp.org --recv-keys 7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C && \
45 gpg --batch --keyserver keyserver.ubuntu.com --recv-keys FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01
46 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
47
48 RUN set -o pipefail && \
49 bash <(curl -L https://releases.nixos.org/nix/nix-2.15.0/install) --no-daemon && \
50 locale-gen en_US.UTF-8 && chown root -R /nix
51
52 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
53 ENV USER=root
54 ENV SHELL /bin/bash
55 RUN . "$HOME/.nix-profile/etc/profile.d/nix.sh" && \
56 mkdir -p "/builds/gargantext/" && chmod 777 -R "/builds/gargantext" && \
57 echo "source $HOME/.nix-profile/etc/profile.d/nix.sh" >> "$HOME/.bashrc" && \
58 echo `which nix-env`
59
60 ENV PATH=/root/.nix-profile/bin:$PATH
61
62 RUN . $HOME/.bashrc && nix-env --version
63
64 RUN \
65 curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
66 chmod +x /usr/bin/ghcup && \
67 ghcup config set gpg-setting GPGLax && \
68 ghcup -v install ghc --force ${GHC} && \
69 ghcup -v install cabal --force ${CABAL} && \
70 ghcup -v install stack --force ${STACK}
71
72 ENV PATH=/root/.ghcup/bin:$PATH
73 ENV PATH=/root/.local/bin:$PATH
74
75
76 RUN cd /builds/gargantext && nix-shell
77 RUN ghcup set 8.10.7 && cabal v2-update && cabal v2-install hpack --overwrite-policy=always
78
79 WORKDIR "/builds/gargantext/"