-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (30 loc) · 990 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
44
45
46
47
48
49
FROM elixir:1.12-alpine AS build
RUN apk add --no-cache build-base npm
WORKDIR /app
RUN mix local.hex --force && \
mix local.rebar --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
RUN mix do deps.get, deps.compile
COPY assets/package.json assets/package-lock.json ./assets/
RUN mix assets.deps.get
COPY assets assets
RUN mix assets.compile
COPY config config
RUN mix phx.digest
COPY lib lib
RUN mix do compile, release
FROM elixir:1.12-alpine
RUN apk add --no-cache openssl ncurses-libs
WORKDIR /app
ENV PATH="/app:${PATH}"
RUN chown nobody:nobody /app
RUN printf "#!/bin/sh\nset -xe\n./baambook/bin/baambook start" > ./start
RUN printf "#!/bin/sh\nset -xe\n./baambook/bin/baambook rpc $@" > ./rpc
RUN printf "#!/bin/sh\nset -xe\n./baambook/bin/baambook remote" > ./remote
RUN chmod +x ./start ./rpc ./remote
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/baambook ./baambook/
ENV HOME=/app
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["start"]