-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 983 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
34
35
36
37
38
39
40
41
FROM elixir:1.9.0
ENV DEBIAN_FRONTEND=noninteractive
ENV MIX_HOME=/opt/mix
# Compile elixir files for production
ENV MIX_ENV prod
# Install hex
RUN mix local.hex --force
# Install rebar
RUN mix local.rebar --force
# Install the Phoenix framework itself
RUN mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez --force
# Install NodeJS and the NPM
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y -q nodejs
# Suggested https://hexdocs.pm/phoenix/installation.html
RUN apt-get update && apt-get install -y \
inotify-tools \
&& apt-get install -y apt-utils \
&& apt-get install -y build-essential \
&& rm -rf /var/lib/apt/lists/*
# When this image is run, make /app the current working directory
ENV APP_HOME /opt/app
RUN mkdir -p $APP_HOME
ADD . $APP_HOME
WORKDIR $APP_HOME
RUN mix deps.get
RUN mix compile \
&& mix phx.digest
RUN useradd -m myuser
USER myuser
CMD MIX_ENV=prod mix phx.server