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

fix: how Elixir is installed in the Dockerfile #88

Merged
merged 3 commits into from
Jul 27, 2024
Merged
Changes from 2 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
30 changes: 13 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM aeternity/builder:focal-otp26 as builder
FROM aeternity/builder:focal-otp26 AS builder

SHELL ["/bin/bash", "-l", "-c"]

ENV ERLANG_ROCKSDB_OPTS "-DWITH_SYSTEM_ROCKSDB=ON -DWITH_LZ4=ON -DWITH_SNAPPY=ON -DWITH_BZ2=ON -DWITH_ZSTD=ON"
ENV ERLANG_ROCKSDB_OPTS="-DWITH_SYSTEM_ROCKSDB=ON -DWITH_LZ4=ON -DWITH_SNAPPY=ON -DWITH_BZ2=ON -DWITH_ZSTD=ON"

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -qq update \
&& apt-get -qq -y install apt-utils git g++ cmake autoconf clang curl wget \
Expand All @@ -28,9 +28,9 @@ RUN ln -fs librocksdb.so.6.13.3 /usr/local/lib/librocksdb.so.6.13 \

# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# Install nodejs
RUN apt-get update && apt-get install -y ca-certificates curl gnupg
Expand All @@ -39,27 +39,23 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg -
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install nodejs -y

# Install kiex and Elixir (apt provides an outdated version unfortunately)
RUN curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | bash -s
# Install Elixir
RUN curl -OL https://github.com/elixir-lang/elixir/releases/download/v1.17.2/elixir-otp-26.zip
RUN mkdir elixir-otp-26 && unzip elixir-otp-26.zip -d elixir-otp-26

RUN source "$HOME/.kiex/scripts/kiex" \
&& kiex install 1.16

ENV ELIXIR_VERSION "1.16-"
ENV PATH /root/.kiex/elixirs/elixir-1.16-/bin:${PATH}
ENV MIX_ARCHIVES /root/.kiex/mix/archives/elixir-1.16-
ENV PATH=/elixir-otp-26/bin:${PATH}

ADD . /app
WORKDIR /app

# Setup the server

ENV MIX_ENV prod
ENV MIX_ENV=prod
RUN mkdir -p /etc/profile.d \
&& KEY_BASE="$(openssl rand -hex 64)" \
&& echo export SECRET_KEY_BASE=$KEY_BASE >> /etc/profile.d/aerepl-web.sh

ENV CXXFLAGS "-Wno-error=shadow -Wno-deprecated-copy -Wno-redundant-move -Wno-pessimizing-move"
ENV CXXFLAGS="-Wno-error=shadow -Wno-deprecated-copy -Wno-redundant-move -Wno-pessimizing-move"

RUN mix local.rebar --force \
&& mix local.hex --force \
Expand Down Expand Up @@ -94,7 +90,7 @@ COPY --from=builder /app /repl

WORKDIR /repl

CMD _build/prod/rel/app/bin/app start
CMD ["_build/prod/rel/app/bin/app", "start"]

# Erl handles SIGQUIT instead of the default SIGINT
STOPSIGNAL SIGQUIT
Expand Down
Loading