-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (34 loc) · 1.05 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
FROM docker.io/elixir:1.15-alpine
MAINTAINER Gabe <gmp@gmp.io>
ARG app_name=apollos_crib
ARG phoenix_subdir=.
ARG build_env=prod
ENV MIX_ENV=${build_env} TERM=xterm
WORKDIR /opt/app
RUN apk update \
&& apk --no-cache --update add git make gcc g++ erlang-dev openssl-dev npm openssh gnu-libiconv \
&& mix local.rebar --force \
&& mix local.hex --force
COPY . .
RUN mix do deps.get, compile
RUN npm install -g npm@6.14.4
RUN cd ${phoenix_subdir}/apps/room_sanctum/assets \
&& npm ci \
&& cd ../ \
&& mix download_data \
&& mix phx.digest \
&& mix assets.deploy \
&& cd ../../ \
RUN mix download_data
RUN mix release ${app_name} \
&& mv _build/${build_env}/rel/${app_name} /opt/release \
&& mv /opt/release/bin/${app_name} /opt/release/bin/start_server
FROM alpine:latest
ARG project_id
RUN apk update \
&& apk --no-cache --update add bash ca-certificates openssl-dev libgcc libstdc++ librsvg imagemagick libcrypto3
EXPOSE 4002
EXPOSE 4001
WORKDIR /opt/app
COPY --from=0 /opt/release .
CMD exec /opt/app/bin/start_server start