diff --git a/.dockerignore b/.dockerignore index dff38d74d..165431a9a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,29 @@ +& +01-index +.envrc +.hie +.hspec-failures +/.stack-work/ +< +Session.vim +_database/ +_data/ +dist-newstyle +environment.local.sh +environment.prod.sh +ghcid.text +tags +tags.mtime -assets/node_modules \ No newline at end of file +/static/* +assets/node_modules +assets/yarn-error.log +assets/fonts +result* +cbits/*.cpp +pgdata/ +.vscode/ +.DS_Store +tags.lock +cabal.project.local +logs/* diff --git a/Dockerfile b/Dockerfile index 9d06d7552..068afd4ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,24 @@ # syntax=docker/dockerfile:1 -FROM gbogard/haskell-bullseye:9.2.4 +FROM ubuntu:22.04 # generate a working directory WORKDIR /flora-server +RUN apt update +RUN apt install -y build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 git +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh +RUN echo 'export PATH="$PATH:/root/.ghcup/bin"' >> /etc/profile +ENV PATH="$PATH:/root/.ghcup/bin" +RUN ghcup install ghc 9.2.4 && ghcup set ghc 9.2.4 && ghcup install cabal + # install dependencies (pg_config, postgresql-client, postrgresql-migrations & yarn) RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -RUN curl -fsSL https://deb.nodesource.com/setup_17.x | bash - +RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt update -RUN apt install -y nodejs yarn libpq-dev mcpp wget zsh tmux postgresql-client -RUN cabal install postgresql-migration +RUN apt install -y nodejs libpq-dev mcpp wget zsh tmux postgresql-client +RUN corepack enable +RUN cabal update +RUN cabal install -j8 postgresql-migration # install soufflé RUN wget --content-disposition https://github.com/souffle-lang/souffle/releases/download/2.2/x86_64-ubuntu-2004-souffle-2.2-Linux.deb @@ -23,8 +31,7 @@ COPY scripts/.zshrc /root/.zshrc # build Haskell dependencies COPY Makefile cabal.project flora.cabal ./ -RUN cabal update -RUN cabal build --only-dependencies -j8 +RUN cabal build --only-dependencies -j # Compile Souffle source files COPY cbits ./cbits