-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.local
54 lines (43 loc) · 990 Bytes
/
Dockerfile.local
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
52
53
54
FROM elixir:1.9.4
ARG SLACK_TOKEN
ARG KOIN_BOT_ID
ARG APP_NAME
ARG APP_VSN
ARG MIX_ENV=prod
ARG SKIP_PHOENIX=true
ARG PHOENIX_SUBDIR=.
ENV APP_NAME=${APP_NAME} \
APP_VSN=${APP_VSN} \
HOME=/usr/src/alex-koin \
KOIN_BOT_ID=${KOIN_BOT_ID} \
MIX_ENV=${MIX_ENV} \
SLACK_TOKEN=${SLACK_TOKEN}
WORKDIR $HOME
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
build-essential \
inotify-tools \
git \
nodejs \
yarn \
postgresql-client && \
mix local.rebar --force && \
mix local.hex --force
COPY mix.* $HOME/
COPY deps/* $HOME/deps/
RUN mix do deps.get, deps.compile
RUN mix compile
COPY . $HOME
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# This is for a PHOENIX frontend
RUN if [ ! "$SKIP_PHOENIX" = "true" ]; then \
cd ${PHOENIX_SUBDIR}/assets && \
yarn install && \
yarn deploy && \
cd .. && \
mix phx.digest; \
fi
EXPOSE 4000