-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed build error while using the *Docker workflow* I was faced with this error after running *docker-compose up -d --build*. ``` Configuring postgresql-libpq-0.9.4.3... setup: The program 'pg_config' is required but it could not be found. ``` Fixed it by installing the Postgres dev tools like pg_config inside the Flora dev container * Fixed the Docker workflow - Switched the base Docker image from Buster to Bullseye so the latest Soufflé version (2.2) can be installed - Installed Soufflé in the container - Installed Tmux in the container - Set up a nice development shell inside the Docker container. The shell uses ZSH, Oh-my-ZSH, and a nice welcom message. The environment variables are set automatically.
- Loading branch information
Showing
7 changed files
with
51 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM haskell:8.10 | ||
FROM gbogard/haskell-bullseye:8.10.7 | ||
|
||
# generate a working directory | ||
WORKDIR /flora-server | ||
|
||
# copy the files relevant to build core dependencies | ||
COPY cabal.project flora.cabal shell.nix environment.sh environment.docker.sh Makefile scripts/start-tmux.sh ./ | ||
# install dependencies (pg_config & 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 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 | ||
|
||
RUN cabal update | ||
# let nix build the dependencies. This uses nix-shell to cache the setup phase. | ||
RUN cabal build -j4 | ||
# 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 | ||
RUN apt install -f -y ./x86_64-ubuntu-2004-souffle-2.2-Linux.deb | ||
|
||
# copy asset-relevant dependency files | ||
COPY assets/package.json assets/yarn.lock assets/ | ||
RUN make assets-deps | ||
# configure the shell | ||
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | ||
COPY scripts/shell-welcome.txt /etc/motd | ||
COPY scripts/.zshrc /root/.zshrc | ||
|
||
# build Haskell dependencies | ||
COPY Makefile cabal.project flora.cabal ./ | ||
RUN cabal build --only-dependencies -j8 | ||
|
||
# Compile Souffle source files | ||
COPY cbits ./cbits | ||
RUN make souffle | ||
|
||
# copy and build the assets | ||
COPY assets ./assets | ||
RUN make build-assets | ||
|
||
RUN echo $PATH > /etc/profile | ||
CMD [ "/bin/sh", "-c", "sleep 1d"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
source environment.sh | ||
export ZSH="$HOME/.oh-my-zsh" | ||
ZSH_THEME="robbyrussell" | ||
|
||
export FLORA_DB_HOST="database" | ||
plugins=(git) | ||
|
||
source $ZSH/oh-my-zsh.sh | ||
source /flora-server/environment.sh | ||
export FLORA_DB_HOST="database" | ||
export FLORA_PG_URI="postgresql://${FLORA_DB_USER}:${FLORA_DB_PASSWORD}@${FLORA_DB_HOST}:${FLORA_DB_PORT}/${FLORA_DB_DATABASE}" | ||
export FLORA_PG_CONNSTRING="host=${FLORA_DB_HOST} dbname=${FLORA_DB_DATABASE} user=${FLORA_DB_USER} password=${FLORA_DB_PASSWORD}" | ||
|
||
|
||
export FLORA_HTTP_PORT=8084 | ||
|
||
cat /etc/motd |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
tmux kill-session -t 'flora' || true | ||
|