wallyfoo

wallyfoo

I spent most of a day trying to deploy a new Phoenix app (and an umbrella application) via dokku to my test server.

All the deployments fail on the node assets fetching stage. It seems that the heroku phoenix static buildfile that’s the de facto build for Phoenix requires a version of node that is incompatible with a number of packages Phoenix 1.5 wants to build. (Many, many of them are looking for a minimum of 8 or 10, and the build file wants to provide Node 5.something.)

Setting the version of node higher in a build config file fails for other reasons. I’ve checked the git issues for the static build file, and a related error is there, but no fix has been offered.

My question is, has anyone had any luck deploying Phoenix 1.5 to Heroku/Dokku? If so, how did you manage it?

If not, what’s your preferred deployment solution because I’m really digging on 1.5, but my deployment pipeline for simple one-off projects seems to have just collapsed.

Showing Posts 1 to 10

outlog

outlog

have you added the phoenix_static_buildpack? and made sure they are in correct order.. then Deploying on Heroku — Phoenix v1.8.8 for setting node version..

jswny

jswny

I used to use Heroku but it got too expensive for running a few personal apps. I also tried Dokku but it was more complicated than I expected and I couldn’t get it setup right.

I ended up going with a very simple solution; using some SSH scripts to deploy my apps. It’s not the prettiest, but it works quite well. I have it working on a few apps. My solution is here if you are interested: GitHub - jswny/sad: Simple app deployment using only SSH and Docker. · GitHub. Basically, you have the CI build the Docker image, push it to Docker hub, and then just SSH into the remote server copying over your Docker Compose file, which pulls down the new image and runs docker-compose up. That repository has a few extra environment variable handling niceties which I use to configure the apps based on their release channel, so it also copies over a .env populated with the right environment variables for your apps.

wallyfoo

wallyfoo OP

Since docker containers are immutable, how do you deal with agents and whatnot getting shutdown and restarted? Like if you had an session tracker that wasn’t connected to a database backup?

wallyfoo

wallyfoo OP

Thanks for the suggestion, outlog. I double-checked, and yes, I’m loading in the correct order and I do have the node version set correctly in the phoenix_static_buildpack.config.

It’s possible I misconfigured something else. I’m probably going to just rebuild the VM from the ground up and try again from scratch to see what, if anything, I missed.

jswny

jswny

From my experience Docker Compose is smart enough to only restart containers that have images which actually changed. So, my database container never changes, so it doesn’t restart when I change my code since it’s image is not any different.

However, the image for my app obviously changes, so docker will restart that.

So, if you don’t keep any state in the application container then it will be fine.

outlog

outlog

can you post the error log - and what node version you have config’ed?

wallyfoo

wallyfoo OP

I started over. Wiped out my dokku installation, re-initialized my phoenix 1.5 application. Somewhere while tweaking the configuration for the umbrella app, I must have done something incorrectly, because it seems to work now. Going to try the same for a plain vanilla phoenix application.

wallyfoo

wallyfoo OP

I’ll reply to myself in case someone else also finds themselves in this position.

If the dokku push fails in any compilation step, make sure the phoenix_static_buildpack.config contains this line:

clean_cache=true

A failure could easily cache bad data, and you’ll need to wipe all that out and try again. set it to false after success or you’re just increasing your deployment time needlessly.

mupkoo

mupkoo

I think that if you set the engine version in your package.json file, it will load this version of Node. For example:

{
  //....
  "engines": {
    "node": "10.19.0",
    "yarn": "1.22.4"
  }
}
wallyfoo

wallyfoo OP

Thanks for the tip. I’ll see if that’s an alternate solution.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews