Closed fdeage closed 2 years ago
Your mix file should have the assets.deploy
alias:
defp aliases do
[
setup: ["deps.get", "ecto.setup"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.deploy": [
"tailwind default --minify",
"esbuild default --minify",
"phx.digest"
]
]
end
And your Dockerfile should call the deploy task before running mix compile:
# compile assets
RUN mix assets.deploy
RUN mix compile
Thanks @chrismccord for your response.
I fail to understand, though, how running tailwind default --minify
can... download and install tailwind somehow?
The only rule I have telling to install tailwind
is in config/dev.exs
:
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
but there is nothing like that anywhere else :/
It installs it by default if it's not there :)
OK, thanks!
I don't understand when the Tailwind binary is downloaded and installed in a prod environment.
I got this error during deploy:
And here is my Dockerfile, which comes straight from the Fly.io documentation:
What am I missing here? Should I download the Tailwind binary separately?