From 930afe034a41bee7b0888d734317116eef221a64 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 20 Feb 2022 02:12:44 +0100 Subject: Create Docker setup --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..32b9e6c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +FROM elixir:latest AS elixir-deps +WORKDIR /rook + +RUN mix local.hex --force +RUN mix local.rebar --force + +ENV MIX_ENV=prod + +COPY mix.exs mix.lock ./ +RUN mix deps.get --only prod +RUN mix ua_inspector.download --force +RUN mix deps.compile + +FROM node:latest AS node +WORKDIR /rook/assets + +# Needed for phoenix.js +COPY --from=elixir-deps /rook/deps ../deps +COPY assets/package.json ./ +COPY assets/yarn.lock ./ + +RUN yarn install + +COPY assets ./ +RUN yarn deploy + +FROM elixir-deps AS elixir +WORKDIR /rook +ARG SECRET_KEY_BASE + +COPY config config +COPY lib lib + +COPY --from=node /rook/priv priv +RUN mix phx.digest + +COPY --from=elixir-deps /rook ./ +RUN mix do compile + +ENV MIX_ENV=prod +ENV SECRET_KEY_BASE=$SECRET_KEY_BASE +CMD ["mix", "phx.server"] \ No newline at end of file -- cgit 1.4.1