Skip to content

Commit

Permalink
[FLORA-180] Restore docker (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven authored Nov 22, 2022
1 parent 715d184 commit 1748fd2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
29 changes: 28 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -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
/static/*
assets/node_modules
assets/yarn-error.log
assets/fonts
result*
cbits/*.cpp
pgdata/
.vscode/
.DS_Store
tags.lock
cabal.project.local
logs/*
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1748fd2

Please sign in to comment.