mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-16 03:47:56 +01:00
84 lines
1.9 KiB
Docker
84 lines
1.9 KiB
Docker
|
|
FROM ubuntu:22.04
|
||
|
|
|
||
|
|
# Set bash as the default shell
|
||
|
|
SHELL ["/bin/bash", "-c"]
|
||
|
|
|
||
|
|
# Avoid prompts during package installation
|
||
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
||
|
|
|
||
|
|
# Set up timezone
|
||
|
|
RUN apt-get update && apt-get install -y tzdata \
|
||
|
|
&& ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
|
||
|
|
&& dpkg-reconfigure -f noninteractive tzdata
|
||
|
|
|
||
|
|
# Install dependencies
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
build-essential \
|
||
|
|
git \
|
||
|
|
curl \
|
||
|
|
wget \
|
||
|
|
gnupg \
|
||
|
|
ca-certificates \
|
||
|
|
apt-transport-https \
|
||
|
|
lsb-release \
|
||
|
|
python3 \
|
||
|
|
openssl \
|
||
|
|
libncurses5-dev \
|
||
|
|
locales \
|
||
|
|
inotify-tools \
|
||
|
|
unzip \
|
||
|
|
automake \
|
||
|
|
autoconf \
|
||
|
|
libreadline-dev \
|
||
|
|
libssl-dev \
|
||
|
|
libyaml-dev \
|
||
|
|
libxslt-dev \
|
||
|
|
libffi-dev \
|
||
|
|
libtool \
|
||
|
|
openjdk-11-jdk \
|
||
|
|
&& apt-get clean \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
# Set 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
|
||
|
|
|
||
|
|
# Install asdf
|
||
|
|
ENV ASDF_VERSION=0.18.0
|
||
|
|
RUN wget https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz \
|
||
|
|
&& tar -xzf asdf-v${ASDF_VERSION}-linux-arm64.tar.gz \
|
||
|
|
&& rm asdf-v${ASDF_VERSION}-linux-arm64.tar.gz \
|
||
|
|
&& mv asdf /usr/bin/
|
||
|
|
|
||
|
|
|
||
|
|
# Install Erlang and Elixir using asdf
|
||
|
|
RUN asdf plugin add erlang \
|
||
|
|
&& asdf plugin add elixir \
|
||
|
|
&& asdf install erlang 26.2.1 \
|
||
|
|
&& asdf install elixir 1.16.0 \
|
||
|
|
&& asdf set -u erlang 26.2.1 \
|
||
|
|
&& asdf set -u elixir 1.16.0
|
||
|
|
|
||
|
|
# Install Node.js using asdf
|
||
|
|
RUN asdf plugin add nodejs \
|
||
|
|
&& asdf install nodejs 22.1.0 \
|
||
|
|
&& asdf set -u nodejs 22.1.0
|
||
|
|
|
||
|
|
ENV PATH="/root/.asdf/shims:$PATH"
|
||
|
|
|
||
|
|
# Install Hex and Phoenix
|
||
|
|
RUN mix local.hex --force \
|
||
|
|
&& mix local.rebar --force \
|
||
|
|
&& mix archive.install hex phx_new --force
|
||
|
|
|
||
|
|
# custom ERL_FLAGS are passed for (public) multi-platform builds
|
||
|
|
ARG ERL_FLAGS
|
||
|
|
ENV ERL_FLAGS=$ERL_FLAGS
|
||
|
|
|
||
|
|
EXPOSE 4000
|
||
|
|
USER root
|
||
|
|
WORKDIR /app
|
||
|
|
ENTRYPOINT ["mix", "phx.server"]
|