forked from nighthawk-apps/zcash-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (32 loc) · 914 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.14.4-alpine AS build
# install build dependencies
RUN apk add --update --no-cache build-base --update nodejs npm git
# prepare build dir
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
COPY config config
RUN mix do deps.get, deps.compile
COPY assets/package.json ./assets/
RUN npm install --prefix=assets
# should be before running npm deploy
COPY lib lib
copy rel rel
COPY priv priv
COPY assets assets
RUN npm run deploy --prefix=assets
RUN mix phx.digest
RUN mix do release
# prepare release image
FROM alpine:3.17.3 AS app
RUN apk add --no-cache openssl ncurses-libs libstdc++ libgcc
WORKDIR /app
RUN chown nobody:nobody /app
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/zcash_explorer ./
ENV HOME=/app
CMD ["bin/zcash_explorer", "start"]