Skip to content

Commit

Permalink
chore: update Elixir/Erlang/Node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulswartz committed Oct 24, 2023
1 parent e5047e9 commit fc1e54a
Show file tree
Hide file tree
Showing 3 changed files with 8,761 additions and 6,146 deletions.
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.14.2-otp-25
erlang 25.2
nodejs 14.17.1
elixir 1.14.5-otp-25
erlang 25.3.2.7
nodejs 20.8.1
54 changes: 38 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
FROM hexpm/elixir:1.14.2-erlang-25.2-debian-bullseye-20221004 as builder
ARG ELIXIR_VERSION=1.14.5
ARG ERLANG_VERSION=25.3.2.7
ARG DEBIAN_VERSION=bullseye-20230612

FROM hexpm/elixir:$ELIXIR_VERSION-erlang-$ERLANG_VERSION-debian-$DEBIAN_VERSION as elixir-builder

ENV LANG=C.UTF-8 \
MIX_ENV=prod

RUN apt-get update --allow-releaseinfo-change && \
apt-get install -y --no-install-recommends ca-certificates curl git
apt-get install -y --no-install-recommends ca-certificates curl git gnupg

RUN mix local.hex --force && \
mix local.rebar --force

# Instructions from:
# https://github.com/nodesource/distributions/blob/master/README.md
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
# https://github.com/nodesource/distributions#debian-versions

ARG NODE_MAJOR=20

RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && \
apt-get install nodejs -y

WORKDIR /root
ADD . .

RUN mix local.hex --force && \
mix local.rebar --force && \
mix do deps.get --only prod, compile --force && \
mix esbuild.install && \
npm --prefix assets ci && \
mix assets.deploy && \
mix release
COPY mix.exs mix.exs
COPY mix.lock mix.lock

RUN mix do deps.get --only prod, esbuild.install

COPY assets assets

RUN npm --prefix assets ci

COPY config/config.exs config/
COPY config/prod.exs config/

RUN mix compile

COPY config/runtime.exs config
COPY lib lib

RUN mix release

FROM debian:bullseye-20221004
FROM debian:$DEBIAN_VERSION

RUN apt-get update --allow-releaseinfo-change && \
apt-get install -y --no-install-recommends libssl1.1 libsctp1 curl && \
Expand All @@ -33,6 +55,6 @@ WORKDIR /root
EXPOSE 4000
ENV MIX_ENV=prod TERM=xterm LANG="C.UTF-8" PORT=4000

COPY --from=builder /root/_build/prod/rel/arrow .
COPY --from=elixir-builder /root/_build/prod/rel/arrow .

CMD ["bin/arrow", "start"]
Loading

0 comments on commit fc1e54a

Please sign in to comment.