igor

igor

Docker container image for Phoenix development with specific OS, Erlang and Elixir versions

Hi, everyone!
If I want to develop a Phoenix project and build a release specifically for Ubuntu 18.04 (bionic), Erlang 22 and Elixir 1.10.2 in Docker container and I’m looking for an image to base my Dockerfile from what is my best option?
I’ve read a topic on this forum that hexpm published docker images for all erlang and elixir versions. I went to docker hub and found hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219 image.
Seems exactly what I need, but I’m not sure because in the description of the image I don’t see what’s installed, the layers add some file and copy some dir, that’s basically it.
The link to the image: Image Layer Details - hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219
Besides Elixir code I need to build some c code in the container (bcrypt is used) and a webpack stuff for Phoenix, so is it enough to just make a Dockerfile like this:

FROM hexpm/elixir:1.10.2-erlang-22.2-ubuntu-bionic-20200219

RUN apt-get update && \
    apt-get install -y postgresql-client && \
    apt-get install -y inotify-tools && \
    apt-get install -y nodejs && \
    curl -L https://npmjs.org/install.sh | sh && \
    mix local.hex --force && \
    mix archive.install hex phx_new 1.5.3 --force && \
    mix local.rebar --force

ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

CMD ["mix", "phx.server"]

or I should add more tooling? Or I shouldn’t use this image for my purpose and start building my image from scratch? I’m new to docker, so have many doughts.

First Post!

Aetherus

Aetherus

Only Erlang, Elixir and Mix are pre-installed.

If you need to build some C code, build-essential is what you want in the building-stage image. (you don’t want it in your running-stage image.)

You also need to install nodejs <= 10.x and npm in the building-stage image unless you generated your Phoenix app with the --no-webpack --no-html options.

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement