tenzil

tenzil

Suggestions for Phoenix deployment in AWS

Hi folks, i am planning on deploying my app in aws. I have deployed Rails app in EC2. But its my first time for elixir, phoenix. So please guide me here, without docker.
App is a simple, now. it may grow bigger after a month or 2. and there will be a chat functionality (one to one). I have already deployed my app in heroku and gigalixir using distillery. wanted to do the same in aws
Please guide me here

Marked As Solved

kreiling.io

kreiling.io

I only deploy with Elixir releases nowadays. I have to say you shouldn’t shy away from Docker, necessarily!

If you’re trying to deploy to a VPS (such as EC2), I actually do the following:

  • Setup infrastructure such as databases and Nginx on the host
  • Write a script for building the release in a Docker image with the same OS as the host you’re deploying to. The release can produce a tarball, which you copy out of the Docker image and rsync it to the server.
  • The rest is easy - untar it on the server, stop the old application, and fire up the new release!

For secrets, I have a prod.env file on the host that is loaded using bash’s source command, and those env vars are loaded by rel/releases.exs on-boot.

Also Liked

kreiling.io

kreiling.io

I keep a folder full of secret files on my dev laptop synchronized with all of my hosts through rsync, and that is how I distribute secrets to my hosts. This way I can share common secrets across my hosts in the same file(s)

However I’d be wary of doing this in the event that you need to collaborate and synchronize secrets across more than 5-10 developers - then you might want to look into something remote & secure, such as AWS Secrets Manager or AWS Parameter Store.

tenzil

tenzil

Found edeliver, reading http://blog.plataformatec.com.br/2016/06/deploying-elixir-applications-with-edeliver/
will update soon how it goes. please do post your suggestions

elcritch

elcritch

That article is pretty out of date at this point. Elixir 1.9+ has releases built into mix. There’s other threads here on the topic, but you could start with the Phoenix docs on releases at https://hexdocs.pm/phoenix/releases.html as a good reference point.

And welcome to Phoenix! It’s a fun framework.

gcauchon

gcauchon

This got me curious! What aspect of your design discard Docker from the equation?

I’ve deployed many Elixir web applications to cloud providers with (then) Distillery and (now) mix release and it is, imho so much simpler for 95% of the use cases…

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
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
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
Tee
can someone please explain to me how Enum.reduce works with maps
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
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement