From 92119e66793731db94a0f114033f5b36cf7faba3 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Thu, 28 Nov 2024 10:23:34 +0200 Subject: [PATCH] ci: update dockerfile --- .gitignore | 3 --- Dockerfile | 4 +++- rel/overlays/bin/migrate | 5 +++++ rel/overlays/bin/migrate.bat | 1 + rel/overlays/bin/server | 5 +++++ rel/overlays/bin/server.bat | 2 ++ 6 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 rel/overlays/bin/migrate create mode 100755 rel/overlays/bin/migrate.bat create mode 100755 rel/overlays/bin/server create mode 100755 rel/overlays/bin/server.bat diff --git a/.gitignore b/.gitignore index b9374ba..85037b9 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,3 @@ exmr-*.tar # In case you use Node.js/npm, you want to ignore these. npm-debug.log /assets/node_modules/ - -# ignore release artifacts -/rel/ diff --git a/Dockerfile b/Dockerfile index 2c6b13a..82c6b0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,12 +38,14 @@ ENV MIX_ENV="prod" COPY mix.exs mix.lock ./ RUN mix deps.get --only $MIX_ENV RUN mkdir config +RUN mkdir rel +RUN mix phx.gen.release # copy compile-time config files before we compile dependencies # to ensure any relevant config change will trigger the dependencies # to be re-compiled. COPY config/config.exs config/${MIX_ENV}.exs config/ -RUN mix deps.compile +RUN mix deps.compile --only $MIX_ENV COPY priv priv diff --git a/rel/overlays/bin/migrate b/rel/overlays/bin/migrate new file mode 100755 index 0000000..6e73f0c --- /dev/null +++ b/rel/overlays/bin/migrate @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu + +cd -P -- "$(dirname -- "$0")" +exec ./exmr eval Exmr.Release.migrate diff --git a/rel/overlays/bin/migrate.bat b/rel/overlays/bin/migrate.bat new file mode 100755 index 0000000..88fc0ac --- /dev/null +++ b/rel/overlays/bin/migrate.bat @@ -0,0 +1 @@ +call "%~dp0\exmr" eval Exmr.Release.migrate diff --git a/rel/overlays/bin/server b/rel/overlays/bin/server new file mode 100755 index 0000000..1280527 --- /dev/null +++ b/rel/overlays/bin/server @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu + +cd -P -- "$(dirname -- "$0")" +PHX_SERVER=true exec ./exmr start diff --git a/rel/overlays/bin/server.bat b/rel/overlays/bin/server.bat new file mode 100755 index 0000000..e4734b2 --- /dev/null +++ b/rel/overlays/bin/server.bat @@ -0,0 +1,2 @@ +set PHX_SERVER=true +call "%~dp0\exmr" start