-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 980 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
FROM hexpm/elixir:1.11.4-erlang-23.3-debian-buster-20210208 as builder
ENV LANG=C.UTF-8 \
MIX_ENV=prod
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git
# Instructions from:
# https://github.com/nodesource/distributions/blob/master/README.md
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
WORKDIR /root
ADD . .
RUN mix local.hex --force && \
mix local.rebar --force && \
mix do deps.get --only prod, compile --force && \
npm --prefix assets ci && \
npm --prefix assets run deploy && \
mix phx.digest && \
mix release
FROM debian:buster
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl1.1 libsctp1 curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
EXPOSE 4000
ENV MIX_ENV=prod TERM=xterm LANG="C.UTF-8" PORT=4000
COPY --from=builder /root/_build/prod/rel/parking_lpr .
CMD ["bin/parking_lpr", "start"]