-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (24 loc) · 701 Bytes
/
Dockerfile
File metadata and controls
38 lines (24 loc) · 701 Bytes
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 elixir:alpine AS builder
RUN apk add --no-cache build-base git
WORKDIR /app
RUN mix local.hex --force && \
mix local.rebar --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
RUN mix deps.get --only prod
RUN mix deps.compile
COPY lib lib
COPY scripts scripts
RUN elixir scripts/generate_magic_cache.exs
RUN mix compile
FROM elixir:alpine AS runner
RUN apk add --no-cache ncurses-libs zstd libstdc++
WORKDIR /app
RUN addgroup -g 1000 echecs && \
adduser -u 1000 -G echecs -D echecs && \
chown -R echecs:echecs /app
USER echecs
ENV MIX_ENV=prod \
ERL_LIBS=/app/_build/prod/lib
COPY --from=builder --chown=echecs:echecs /app/_build/prod/lib ./_build/prod/lib
CMD ["iex"]