-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
59 lines (29 loc) · 1.13 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
52
53
54
55
56
57
58
59
FROM elixir:1.12.2-alpine AS builder
# install build dependencies
RUN apk add --update git build-base
# Set environment variables for building the application
# too lazy to split build time and run time vars, so provide them at build time so the compiler is happy
ENV MIX_ENV=prod
ARG EDISON_MECHMARKET_ROLE_ID $EDISON_MECHMARKET_ROLE_ID
ARG EDISON_MECHMARKET_QUERY $EDISON_MECHMARKET_QUERY
ARG EDISON_MECHMARKET_CHANNEL $EDISON_MECHMARKET_CHANNEL
ARG EDISON_BOT_TOKEN $EDISON_BOT_TOKEN
# provide at runtime
ENV EDISON_MECHMARKET_ROLE_ID $EDISON_MECHMARKET_ROLE_ID
ENV EDISON_MECHMARKET_QUERY $EDISON_MECHMARKET_QUERY
ENV EDISON_MECHMARKET_CHANNEL $EDISON_MECHMARKET_CHANNEL
ENV EDISON_BOT_TOKEN $EDISON_BOT_TOKEN
# Install hex and rebar
RUN mix local.hex --force && mix local.rebar --force
# Create the application build directory
RUN mkdir /app
WORKDIR /app
# Copy over all the necessary application files and directories
COPY config ./config
COPY lib ./lib
COPY mix.exs mix.lock ./
# get deps because assets depend on them
RUN mix deps.get --only prod
RUN mix deps.compile
RUN mix compile
CMD ["mix", "run", "--no-halt"]