Skip to content

Commit 80f8998

Browse files
committed
Add docker file
1 parent c19ac5f commit 80f8998

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_build
2+
.github
3+
integration

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM erlang:alpine AS builder
2+
3+
RUN apk add --no-cache git
4+
5+
RUN mkdir /build
6+
WORKDIR /build
7+
8+
COPY . seppen
9+
10+
WORKDIR seppen
11+
RUN rebar3 as prod release
12+
13+
FROM alpine
14+
15+
RUN apk add --no-cache openssl && \
16+
apk add --no-cache ncurses-libs && \
17+
apk add --no-cache libstdc++
18+
19+
COPY --from=builder /build/seppen/_build/prod/rel/seppen /seppen
20+
21+
EXPOSE 21285
22+
23+
CMD ["/seppen/bin/seppen", "foreground"]

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DEFAULT_GOAL := all
22

3+
DOCKER_USER := starcrust
34
PROJECT := seppen
45

56
@@ -47,6 +48,10 @@ release:
4748
run: release
4849
$(CURDIR)/_build/default/rel/seppen/bin/seppen foreground
4950

51+
.PHONY: docker
52+
docker:
53+
docker build -t $(DOCKER_USER)/$(PROJECT) .
54+
5055
.PHONY: shell
5156
shell:
5257
rebar3 shell --name $(NODE) --setcookie $(COOKIE) --apps=$(PROJECT)

rebar.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{vm_args_src, "config/vm.args.src"},
1818
{sys_config, "config/dev/sys.config"},
1919
{overlay, [
20-
{copy, ".hosts.erlang", ".hosts.erlang"}
20+
{copy, "config/dev/.hosts.erlang", ".hosts.erlang"}
2121
]},
2222
{extended_start_script, true}
2323
]}.
@@ -27,7 +27,8 @@
2727
%% [{include_src, false}, {debug_info, strip}, {include_erts, true}, {dev_mode, false}]
2828
{relx, [
2929
{mode, prod},
30-
{sys_config, "config/prod/sys.config"}
30+
{sys_config, "config/prod/sys.config"},
31+
{overlay, []}
3132
]}
3233
]}
3334
]}.

0 commit comments

Comments
 (0)