-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (47 loc) · 1.54 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM elixir:1.6.5
WORKDIR /app
COPY . .
RUN cd / && \
mix do local.hex --force, local.rebar --force && \
mix archive.install github heathmont/ex_env tag v0.2.0 --force && \
cd /app && \
rm -rf ./_build/ && \
# echo "Compressing static files..." && \
# mix phx.digest && \
MIX_ENV=prelive mix compile.protocols && \
MIX_ENV=prod mix compile.protocols && \
MIX_ENV=qa mix compile.protocols && \
MIX_ENV=staging mix compile.protocols
CMD echo "Checking system variables..." && \
scripts/show-vars.sh \
"MIX_ENV" \
"ERLANG_OTP_APPLICATION" \
"ERLANG_HOST" \
"ERLANG_MIN_PORT" \
"ERLANG_MAX_PORT" \
"ERLANG_MAX_PROCESSES" \
"ERLANG_COOKIE" && \
scripts/check-vars.sh "in system" \
"MIX_ENV" \
"ERLANG_OTP_APPLICATION" \
"ERLANG_HOST" \
"ERLANG_MIN_PORT" \
"ERLANG_MAX_PORT" \
"ERLANG_MAX_PROCESSES" \
"ERLANG_COOKIE" && \
# echo "Running ecto create..." && \
# mix ecto.create && \
# echo "Running ecto migrate..." && \
# mix ecto.migrate && \
# echo "Running ecto seeds..." && \
# mix run priv/repo/seeds.exs && \
echo "Running app..." && \
elixir \
--name "$ERLANG_OTP_APPLICATION@$ERLANG_HOST" \
--cookie "$ERLANG_COOKIE" \
--erl "+K true +A 32 +P $ERLANG_MAX_PROCESSES" \
--erl "-kernel inet_dist_listen_min $ERLANG_MIN_PORT" \
--erl "-kernel inet_dist_listen_max $ERLANG_MAX_PORT" \
-pa "_build/$MIX_ENV/lib/ex_craft/consolidated/" \
-S mix run \
--no-halt