I currently think it’s related to the Windows environment. Unfortunately I don’t have an easy way to test that right now. I’m away from my home base and I don’t have a Windows VM available. Sorry for the difficulty.
The thing I found odd about the error was that it was trying to pull in the _build folder. Try adding that to the .dockerignore file. Like this: “_build/”
@Mark Just borrowed a colleague’s Mac for the morning and confirmed that the deploy worked perfectly so there’s something going on with Windows (and a different issue with WSL).
Adding _build/ to the .dockerignore didn’t change anything; next idea to try?
Got a working deploy! Inspired by the Mac approach working, I spun up a plain Docker Linux container, copied my files in (private repo so easier than cloning for a proof of concept) and went through the deployment process.
Definitely would be easier to not have to go through that process very often but good to confirm again that Windows is the problem.
Ah! Good catch! Until I can get that updated, here is a resource that I hope helps! It’s a demo project by Jose Valim showing how to setup Phoenix with esbuild:
Is there any guide on how to run multi-region Postgres with a Phoenix app ? I have been looking for different solutions but nothing seems to work properly.
@aswinmohanme I’ve been working on that actually! I’m going to be presenting at ElixirConf2021 showing a few ways to go about it. I don’t have anything ready to publish on the topic at the moment, do you have any specific questions I can try and help with?
Great! I’ll stick with single region deployment in the meantime and concentrate on getting some users, you don’t need multi-region Postgres deployments if no one is using your app .
Thanks for the awesome guide @Mark ! This kind of content has been crucial for me to jump on the Fly train!
The migration doesn’t work for me. I’m not sure what I do wrong, even without anything to do in the migration the deploy fails:
First I make sure there are no migrations to run:
Then I do a fly deploy without any new migrations to run:
$ fly deploy
Deploying xxx-xxx-2877
==> Validating app configuration
...
==> Creating release
Release v31 created
Release command detected: this new release will not be available until the command succeeds.
You can detach the terminal anytime without stopping the deployment
==> Release command
Command: /app/bin/xxx eval Creators.Release.migrate
Starting instance
Configuring virtual machine
Pulling container image
Unpacking image
Preparing kernel init
Setting up volume 'xxx'
Error Release command failed, deployment aborted
I’m able to get the sample app working with migrations, both first time and repeated deploys (with no migrations to run) in MAA, but there are complaints of the release command failing Error Release command failed, deployment aborted - #12 by sudhir.j (in GRU) as well.
There’s a DNS error in the logs reported there, might be the issue.
As for the problem you reported, yes, it’s working for me. Is this still a problem for you or was it lik @sudhir.j mentioned might be the case and it was a temporary regional issue?
The Elixir Getting Started Guide was updated! @jsierles helped bring it up-to-date. It was updated for Phoenix 1.6, it includes a new Dockerfile, the linked hello_elixir github repo was updated too.
Thanks all for the feedback that helped make this better!
I have been following the guide and have an issue. I am using esbuiild and also npm. I am using npm to run a deploy script to minify my css and tailwindcss.
I have worked it out (Should have read the Dockerfile comments a bit earlier). The first change I had to make was to install npm and nodejs packages on the BUILDER container:
The next change was based on the comments that I missed the first time:
# note: if your project uses a tool like https://purgecss.com/,
# which customizes asset compilation based on what it finds in
# your Elixir templates, you will need to move the asset compilation
# step down so that `lib` is available.
This meant I needed to change the order so the Tailwind purge would work.
Dockerfile
COPY lib lib
COPY priv priv
COPY assets assets
RUN mix assets.deploy
RUN mix compile
This was the order that I finally settled on. The last piece of the puzzle was my final error which was that TailwindCSS was unavailable. so I added in the following line before RUN mix assets.deploy
...
RUN cd assets && npm install
RUN mix assets.deploy
...