diff options
| author | Mel <einebeere@gmail.com> | 2022-02-20 02:12:44 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-02-20 02:24:18 +0100 |
| commit | 930afe034a41bee7b0888d734317116eef221a64 (patch) | |
| tree | b20881f83f16f0255d4047d9620522c2ff8f9039 /Dockerfile | |
| parent | 2eb214d74acb7f5cf4cb6271b30d6589192f7018 (diff) | |
| download | rook-930afe034a41bee7b0888d734317116eef221a64.tar.zst rook-930afe034a41bee7b0888d734317116eef221a64.zip | |
Create Docker setup
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 42 |
1 files changed, 42 insertions, 0 deletions
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 |
