compiler Docker & Self-Hosted Deployment

GitHub

Compiler for Elm, a functional language for reliable webapps.

7,776 stars Haskell Haskell 1 file ยท ~13,116 tokens #compiler#elm
1. Pull Image (DOCKERHUB) docker pull elm/compiler:latest
2. Docker Run (1-Click Launch) docker run -d --name compiler --restart always elm/compiler:latest
3. Podman Run podman run -d --name compiler --restart always elm/compiler:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/elm/compiler:latest
5. ORAS Pull (OCI Artifact) oras pull elm/compiler:latest
installers/linux/Dockerfile
# Based initially on https://gist.github.com/rlefevre/1523f47e75310e28eee243c9c5651ac9
#
# Build Linux x64 binary from elm compiler top-level directory:
#
#     container build --arch=amd64 --tag=elm --file=installers/linux/Dockerfile .
#
# Retrieve the Linux binary:
#
#     container run --name=elm --arch=amd64 --detach elm sleep infinity
#     container copy elm:/usr/local/bin/elm ~/Desktop
#     container stop --all
#     container prune
#     container image prune --all
#     container system df
#

FROM alpine:3.17

RUN apk add --no-cache curl pkgconfig build-base musl-dev zlib-dev zlib-static gmp-dev ncurses-dev ncurses-static

WORKDIR /elm

ARG GHCUP_INSTALL_BASE_PREFIX=/elm
ARG PATH="${PATH}:/elm/.ghcup/bin"
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
RUN ghcup install ghc --set 9.10.3
RUN ghcup install cabal --set 3.16.1.0

RUN cabal update

COPY elm.cabal ./
COPY builder builder
COPY compiler compiler
COPY reactor reactor
COPY terminal terminal
COPY src src

RUN cabal build elm --enable-executable-static --ghc-option=-split-sections
RUN cp $(cabal list-bin elm) /usr/local/bin/elm
RUN strip -s /usr/local/bin/elm