]> Git — Sourcephile - gargantext.git/blob - devops/docker/Dockerfile
[DEV] Dev Debug mode
[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 sudo \
35 wget \
36 vim \
37 xz-utils \
38 zlib1g-dev && \
39 apt-get clean && rm -rf /var/lib/apt/lists/* && \
40 mkdir -m 0755 /nix && groupadd -r nixbld && chown root /nix && \
41 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
42
43 RUN gpg --batch --keyserver keys.openpgp.org --recv-keys 7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C && \
44 gpg --batch --keyserver keyserver.ubuntu.com --recv-keys FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01
45 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
46
47 RUN set -o pipefail && \
48 bash <(curl -L https://releases.nixos.org/nix/nix-2.15.0/install) --no-daemon && \
49 locale-gen en_US.UTF-8
50
51 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
52 ENV USER=root
53 ENV SHELL /bin/bash
54 RUN . "$HOME/.nix-profile/etc/profile.d/nix.sh" && \
55 mkdir -p "/builds/gargantext/" && chmod 777 -R "/builds/gargantext" && \
56 echo "source $HOME/.nix-profile/etc/profile.d/nix.sh" >> "$HOME/.bashrc" && \
57 echo `which nix-env`
58
59 ENV PATH=/root/.nix-profile/bin:$PATH
60
61 RUN . $HOME/.bashrc && nix-env --version
62
63 RUN \
64 curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
65 chmod +x /usr/bin/ghcup && \
66 ghcup config set gpg-setting GPGLax && \
67 ghcup -v install ghc --force ${GHC} && \
68 ghcup -v install cabal --force ${CABAL} && \
69 ghcup -v install stack --force ${STACK}
70
71 ENV PATH=/root/.ghcup/bin:$PATH
72 ENV PATH=/root/.local/bin:$PATH
73
74
75 RUN cd /builds/gargantext && nix-shell
76 RUN ghcup set 8.10.7 && cabal v2-update && cabal v2-install hpack --overwrite-policy=always
77
78 WORKDIR "/builds/gargantext/"