zoedsoupe
Why my final docker image didn’t find umbrella applications?
I build a Dockerfile as:
FROM hexpm/elixir:1.15.7-erlang-26.1.2-alpine-3.17.5 AS releaser
RUN apk add --no-cache build-base git python3 curl
WORKDIR /app
RUN mix do local.hex --force, local.rebar --force
COPY config/ ./config/
COPY mix.exs mix.lock ./
COPY apps/liquid_auth/mix.exs ./apps/liquid_auth/
COPY apps/liquid_accounts/mix.exs ./apps/liquid_accounts/
COPY apps/liquid_operations/mix.exs ./apps/liquid_operations/
COPY apps/proxy_web/mix.exs ./apps/proxy_web/
COPY apps/release/mix.exs ./apps/release/
COPY apps/liquid_auth/priv ./apps/liquid_auth/
COPY apps/liquid_accounts/priv ./apps/liquid_accounts/
COPY apps/liquid_operations/priv ./apps/liquid_operations/
ENV MIX_ENV=prod
RUN mix deps.get
RUN mix deps.compile
COPY apps/liquid_auth/lib/ ./apps/liquid_auth/
COPY apps/liquid_accounts/lib/ ./apps/liquid_accounts/
COPY apps/liquid_operations/lib/ ./apps/liquid_operations/
COPY apps/proxy_web/lib/ ./apps/proxy_web/
COPY apps/release/lib/ ./apps/release/
RUN mix compile --force
RUN mix release
FROM alpine:3.17.5 AS app
RUN apk add --no-cache libstdc++ openssl ncurses-libs
EXPOSE 4000
ENV PORT=4000 \
MIX_ENV=prod \
SHELL=/bin/bash \
PHX_SERVER=true
WORKDIR /app
COPY --from=releaser /app/_build/prod/rel/liquid ./
CMD ["bin/liquid", "eval", "Release.migrate", "&&", "exec", "bin/liquid", "start"]
and this is my docker-compose.yml:
version: "3.8"
services:
pescarte:
build:
context: .
container_name: liquid_dev
ports:
- 4000:4000
depends_on:
- database
env_file:
- .env-sample
volumes:
- .:/src
environment:
MIX_ENV: dev
stdin_open: true
tty: true
database:
image: postgres:14.6
container_name: liquid_database
environment:
- POSTGRES_USER=liquid
- POSTGRES_PASSWORD=liquid
ports:
- 5432:5432
volumes:
- .postgres:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U liquid -d liquid" ]
interval: 5s
timeout: 2s
retries: 1
However when i try to run docker compose up I get this error:
liquid_dev | ** (UndefinedFunctionError) function Release.migrate/0 is undefined (module Release is not available)
liquid_dev | Release.migrate()
liquid_dev | nofile:1: (file)
liquid_dev | (stdlib 5.1.1) erl_eval.erl:750: :erl_eval.do_apply/7
liquid_dev | (elixir 1.15.7) lib/code.ex:543: Code.validated_eval_string/3
liquid_dev exited with code 1
The full repository with the source code (empty phoenix apps) can be found here
And trying to build with docker build -t liquid-pescarte —no-cache —progress plain . gives all correct instructions and it compiles down all my umbrella apps, so I didn’t understand why on the runtime its brokes.
Popular in Questions
The Elixir Typespec docs show the following syntax for keyword lists in typespecs:
# ...
| [key: type] # keyword lists...
New
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
I have followed this StackOverflow post to install the specific version of Erlang.
And When I am running mix ecto.setup then getting fol...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
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
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Other popular topics
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
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
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition)
It’s been a while since we first asked this, I...
New
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Hi everyone,
I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









