-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update packages, deprecations, devcontainer
and make formatter happy
- Loading branch information
1 parent
e0b304a
commit 33c9e5b
Showing
71 changed files
with
620 additions
and
607 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,67 +1,66 @@ | ||
FROM node:16 AS node_base | ||
FROM node:lts AS node | ||
FROM hadolint/hadolint:latest-alpine AS hadolint | ||
FROM ocaml/opam:debian-ocaml-4.12 | ||
FROM ocaml/opam:debian-10-ocaml-4.14 | ||
|
||
# copy node from node_base container and link commands | ||
USER root | ||
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules | ||
COPY --from=node_base /usr/local/bin/node /usr/local/bin/node | ||
COPY --from=node_base /opt /opt | ||
|
||
# copy node from node container and link commands | ||
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules | ||
COPY --from=node /usr/local/bin/node /usr/local/bin/node | ||
COPY --from=node /opt /opt | ||
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ | ||
&& ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \ | ||
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \ | ||
&& ln -s /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \ | ||
&& ln -s /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg | ||
|
||
# copy hadolint | ||
COPY --from=hadolint /bin/hadolint /bin/hadolint | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV SIHL_ENV development | ||
|
||
RUN apt-get update -q \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
default-jre \ | ||
# emacs-nox for emacs, but sihl cannot be installed without | ||
emacs-nox \ | ||
git \ | ||
# install packages | ||
# hadolint ignore=DL3008 | ||
RUN apt-get update -q && apt-get install -yqq --no-install-recommends \ | ||
# development dependencies | ||
inotify-tools \ | ||
zsh \ | ||
m4 \ | ||
wget \ | ||
# | ||
# build dependencies (would also be installed by opam depext) | ||
gcc \ | ||
libev-dev \ | ||
libffi-dev \ | ||
libfontconfig \ | ||
libgmp-dev \ | ||
libmariadb-dev \ | ||
libpq-dev \ | ||
libqt5gui5 \ | ||
libssl-dev \ | ||
lsof \ | ||
m4 \ | ||
pdftk-java \ | ||
perl \ | ||
pkg-config \ | ||
utop \ | ||
wget \ | ||
wkhtmltopdf \ | ||
xvfb \ | ||
zip \ | ||
zlib1g-dev \ | ||
zsh \ | ||
# | ||
# cleanup installations | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean all \ | ||
# | ||
# add timezone | ||
&& ln -fs /usr/share/zoneinfo/Europe/Zurich /etc/localtime | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# add timezone | ||
RUN ln -fs /usr/share/zoneinfo/Europe/Zurich /etc/localtime | ||
|
||
# WTF: https://github.com/mirage/ocaml-cohttp/issues/675 | ||
RUN bash -c 'echo "http 80/tcp www # WorldWideWeb HTTP" >> /etc/services' \ | ||
&& bash -c 'echo "https 443/tcp www # WorldWideWeb HTTPS" >> /etc/services' | ||
|
||
# Switch back to dialog for any ad-hoc use of apt-get | ||
ENV DEBIAN_FRONTEND=dialog | ||
USER opam | ||
|
||
# install oh-my-zsh | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -q -O - | zsh \ | ||
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \ | ||
&& sed -i "/^plugins=/c\plugins=(git dotenv)" ~/.zshrc | ||
&& sed -i "/^plugins=/c\plugins=(git dotenv)" ~/.zshrc \ | ||
# | ||
# link make to devcontainer makefile | ||
&& echo 'alias make="make -f /workspace/.devcontainer/Makefile"' >> ~/.zshrc | ||
|
||
# Switch back to dialog for any ad-hoc use of apt-get | ||
ENV DEBIAN_FRONTEND=dialog |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include ./Makefile | ||
|
||
SHELL = bash |
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,21 +1,25 @@ | ||
# ocaml/opam post create script | ||
#!/bin/sh | ||
|
||
# immediately when a command fails and print each command | ||
set -ex | ||
|
||
sudo chown -R opam: _build | ||
sudo chown -R opam: node_modules | ||
|
||
# initialize project and update environmemnt | ||
opam init -a --shell=zsh | ||
eval $(opam env) | ||
|
||
# get newest opam packages | ||
opam remote remove --all default | ||
opam remote add default https://opam.ocaml.org | ||
|
||
# ensure all system dependencies are installed | ||
opam pin add . --yes --no-action | ||
opam depext sihl sihl-user sihl-storage sihl-email sihl-queue sihl-cache sihl-token --yes --with-doc --with-test | ||
|
||
eval $(opam env) | ||
|
||
# install opam packages used for vscode ocaml platform package | ||
# e.g. when developing with emax, add also: utop merlin ocamlformat | ||
make deps | ||
opam install -y ocaml-lsp-server | ||
|
||
# install yarn packages | ||
yarn |
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 +1,6 @@ | ||
(env | ||
(dev | ||
(flags | ||
(:standard -w -70 -warn-error -70)))) | ||
|
||
(data_only_dirs node_modules .devcontainer .git) |
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
Oops, something went wrong.