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