diff --git a/Dockerfile b/Dockerfile index 84ce58e73..04f13d722 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,6 @@ RUN apk add --no-cache --update \ g++ \ git \ npm \ - python3 \ wget \ openssl \ libsodium-dev \ @@ -82,5 +81,8 @@ COPY --from=build /opt/code/.git /opt/code/.git WORKDIR /opt/code RUN git reset --hard +RUN rm -rf /opt/code/.git +RUN rm -rf /opt/code/priv + WORKDIR /opt/app CMD /opt/app/bin/archethic_node foreground diff --git a/lib/archethic/governance/code/cicd/docker/cicd.ex b/lib/archethic/governance/code/cicd/docker/cicd.ex index 611136471..ecdd52648 100644 --- a/lib/archethic/governance/code/cicd/docker/cicd.ex +++ b/lib/archethic/governance/code/cicd/docker/cicd.ex @@ -312,11 +312,29 @@ defmodule Archethic.Governance.Code.CICD.Docker do end end - defp testnet_cleanup(_dir, 1, _address_encoded), do: 1 - defp testnet_cleanup(dir, code, address_encoded) do Logger.info("#{dir} Cleanup", address: address_encoded) - System.cmd("docker-compose", ["-f", compose_file(dir), "down", "--volumes"], @cmd_options) + + System.cmd( + "docker-compose", + [ + "-f", + compose_file(dir), + "down", + "--volumes" + ], + @cmd_options + ) + + docker([ + "image", + "rm", + "-f", + "archethic-cd", + "archethic-ci", + "prom/prometheus" + ]) + File.rm_rf!(dir) code end