-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
43 lines (28 loc) · 863 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
42
43
FROM ispirata/elixir:1.10-otp-23 as builder
WORKDIR /app
# Install hex
RUN mix local.hex --force && \
mix local.rebar --force && \
mix hex.info
# Pass --build-arg BUILD_ENV=dev to build a dev image
ARG BUILD_ENV=prod
ENV MIX_ENV=$BUILD_ENV
# Cache elixir deps
ADD mix.exs mix.lock ./
RUN mix do deps.get, deps.compile
# Add all the rest
ADD . .
# Build and release
RUN mix do compile, release
# Note: it is important to keep Debian versions in sync, or incompatibilities between libcrypto will happen
FROM debian:buster-slim
WORKDIR /app
RUN apt-get -qq update
# Set the locale
ENV LANG C.UTF-8
# We need SSL
RUN apt-get -qq install libssl1.1
# We have to redefine this here since it goes out of scope for each build stage
ARG BUILD_ENV=prod
COPY --from=builder /app/_build/$BUILD_ENV/rel/astarte_flow .
CMD ["./bin/astarte_flow", "start"]