-
Notifications
You must be signed in to change notification settings - Fork 17
/
federation_compatibility_dockerfile
51 lines (35 loc) · 1.47 KB
/
federation_compatibility_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
FROM elixir:1.14.2-alpine AS build
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/aws-rds.crt
ADD https://mobile.zscaler.net/downloads/zscaler2048_sha256.crt /usr/local/share/ca-certificates/zscaler.crt
RUN cat /usr/local/share/ca-certificates/*.crt >> /etc/ssl/certs/ca-certificates.crt
WORKDIR /
COPY . .
# prepare build dir
WORKDIR /app
RUN apk add git
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV
ENV MIX_ENV=prod
# install mix dependencies
COPY federation_compatibility/mix.exs federation_compatibility/mix.lock ./
COPY federation_compatibility/config config
ENV SECRET_KEY_BASE=yORg910Gzl54nSsy1HQ1OkKh0sDIj+0eKcSCdt/nyLSl25q41t4Uayqr8BZHSJrI
RUN mix do deps.get, deps.compile
# compile and build release
COPY federation_compatibility/lib lib
RUN mix do compile, release
# prepare release image
FROM alpine:3.16 AS app
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/aws-rds.crt
ADD https://mobile.zscaler.net/downloads/zscaler2048_sha256.crt /usr/local/share/ca-certificates/zscaler.crt
RUN cat /usr/local/share/ca-certificates/*.crt >> /etc/ssl/certs/ca-certificates.crt
RUN apk update
RUN apk add --no-cache openssl libgcc libstdc++ ncurses-libs
WORKDIR /app
RUN chown nobody:nobody /app
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/server ./
ENV HOME=/app
CMD ["bin/server", "start"]