diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..77ff310 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +_build/ +priv/riichi.js +priv/riichi.css +priv/elm-stuff/ +priv/node_modules/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd99785 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM erlang:19.3 as builder +MAINTAINER Correl Roush + +WORKDIR /home/build +RUN apt-get update \ + && apt-get -y install curl gnupg \ + && curl -sL https://deb.nodesource.com/setup_11.x | bash - \ + && apt-get -y install nodejs +COPY . /home/build +RUN rebar3 as prod release + +FROM erlang:19.3-slim +WORKDIR /home/app +ENV RELX_REPLACE_OS_VARS true +COPY --from=builder /home/build/_build/prod/rel/riichi /home/app +EXPOSE 8080 8080 +ENTRYPOINT ["/home/app/bin/riichi"] diff --git a/rebar.config b/rebar.config index 003acab..f0d3831 100644 --- a/rebar.config +++ b/rebar.config @@ -23,3 +23,6 @@ {dev_mode, true}, {include_erts, false}, {extended_start_script, true}]}. + +{profiles, [{prod, [{relx, [{dev_mode, false} + ,{include_erts, true}]}]}]}.