Skip to content

Commit

Permalink
optimize release image size
Browse files Browse the repository at this point in the history
  • Loading branch information
breunigs committed Dec 26, 2024
1 parent 0140fca commit c56f9d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN \
libuv1 \
xauth \
xvfb \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* /var/cache/ /var/log

# map-libre-native shader cache
RUN mkdir -p /.cache && chmod og+wr -R /.cache/
Expand Down
1 change: 1 addition & 0 deletions lib/mix/tasks/deploy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ defmodule Mix.Tasks.Deploy do

defp make_release(_skip) do
Util.banner("Generating Assets")
Search.Meilisearch.Exe.purge_old_data!()
Mix.Tasks.Velo.Assets.Prepare.run([])
Mix.Tasks.Velo.Search.Index.run([])

Expand Down
6 changes: 6 additions & 0 deletions lib/search/meilisearch/exe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ defmodule Search.Meilisearch.Exe do
def version(), do: @version

def path(), do: Path.join(to_string(:code.priv_dir(:veloroute)), @exe)

def purge_old_data!() do
Path.wildcard("priv/meilisearch-*")
|> Enum.reject(&String.contains?(&1, version()))
|> Enum.each(&File.rm_rf!/1)
end
end

0 comments on commit c56f9d5

Please sign in to comment.