Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLORA-180] Restore docker #276

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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