# Since this is a copy of https://github.com/blockscout/devcontainer-elixir/blob/main/Dockerfile # So after successful testing this file, the original one must be updated as well. ARG VARIANT="1.17.3-erlang-27.1-debian-bullseye-20240926" FROM hexpm/elixir:${VARIANT} # ARGs declared before FROM are not persisted beyond the FROM instruction. # They must be redeclared here to be available in the rest of the Dockerfile. ARG PHOENIX_VERSION="1.7.10" ARG NODE_VERSION="18" # This Dockerfile adds a non-root user with sudo access. Update the “remoteUser” property in # devcontainer.json to use it. More info: https://aka.ms/vscode-remote/containers/non-root-user. ARG USERNAME=vscode ARG USER_UID=1000 ARG USER_GID=$USER_UID # Options for common package install script ARG INSTALL_ZSH="true" ARG UPGRADE_PACKAGES="true" ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh" # Options for setup nodejs ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/node-debian.sh" ENV NVM_DIR=/usr/local/share/nvm ENV NVM_SYMLINK_CURRENT=true ENV PATH=${NVM_DIR}/current/bin:${PATH} # Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \ && curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \ && /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ # # Install Node.js for use with web applications && curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \ && /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ && npm install -g cspell@latest \ # # Install dependencies && apt-get install -y build-essential inotify-tools \ # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* /tmp/common-setup.sh /tmp/node-setup.sh RUN su ${USERNAME} -c "mix local.hex --force \ && mix local.rebar --force \ && mix archive.install --force hex phx_new ${PHOENIX_VERSION}"