Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions priv/templates/nova.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
{file, "nova/controller.dtl", "{{name}}/src/views/{{name}}_main.dtl"}.
{file, "nova/.tool-versions", "{{name}}/.tool-versions"}.
{file, "nova/.gitignore", "{{name}}/.gitignore"}.
{template, "nova/Dockerfile", "{{name}}/Dockerfile"}.
{file, "nova/.dockerignore", "{{name}}/.dockerignore"}.
10 changes: 10 additions & 0 deletions priv/templates/nova/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_build
.rebar3
.rebar
.git
log
logs
erl_crash.dump
rebar3.crashdump
*.beam
*.o
29 changes: 29 additions & 0 deletions priv/templates/nova/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARG ERLANG_VERSION
ARG REBAR_VERSION

FROM erlang:${ERLANG_VERSION} AS builder

RUN wget -q "https://github.com/erlang/rebar3/releases/download/${REBAR_VERSION}/rebar3" -O /usr/local/bin/rebar3 && \
chmod +x /usr/local/bin/rebar3

WORKDIR /app

COPY rebar.config rebar.lock ./
RUN rebar3 compile --deps_only

COPY . .
RUN rebar3 as prod release

FROM debian:bookworm-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends libncurses5 libssl3 libstdc++6 && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /app/_build/prod/rel/{{name}} ./

EXPOSE 8080

CMD ["bin/{{name}}", "foreground"]
5 changes: 3 additions & 2 deletions priv/templates/nova/prod_sys.config.src
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
{logger_level, info},
{logger,
[{handler, default, logger_std_h,
#{level => error,
config => #{file => "log/erlang.log"}}}
#{formatter => {nova_jsonlogger, #{new_line => true}}}}
]}
]},
{nova, [
{shutdown_delay, 5000},
{shutdown_drain_timeout, 15000},
{use_stacktrace, false},
{environment, prod},
{cowboy_configuration, #{
Expand Down
9 changes: 5 additions & 4 deletions priv/templates/nova/vm.args.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-sname '{{name}}'

-setcookie {{name}}_cookie
## Distributed Erlang is disabled by default.
## Uncomment the lines below if you need distribution.
## -sname '{{name}}'
## -setcookie {{name}}_cookie

+K true
+A30
+A30