-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (23 loc) · 633 Bytes
/
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
FROM hexpm/elixir:1.14.5-erlang-25.3.2.4-ubuntu-focal-20230126
EXPOSE 80
ARG PORT=${PORT}
ARG SECRET_KEY_BASE=${SECRET_KEY_BASE}
ARG ORIGIN=${ORIGIN}
ARG MIX_ENV=${MIX_ENV}
ENV PORT=${PORT} \
SECRET_KEY_BASE=${SECRET_KEY_BASE} \
ORIGIN=${ORIGIN} \
MIX_ENV=${MIX_ENV}
RUN mkdir -p /var/www
COPY ./config /var/www/config/
COPY ./mix.* /var/www/
WORKDIR /var/www/
RUN rm -Rf _build && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get --only prod && \
mix deps.compile
COPY ./ /var/www/
RUN mix phx.digest
RUN mix release prod
CMD ["_build/prod/rel/prod/bin/prod", "start"]