-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcaprover_docker
More file actions
43 lines (29 loc) · 879 Bytes
/
caprover_docker
File metadata and controls
43 lines (29 loc) · 879 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
39
40
41
42
43
FROM elixir:1.10.3-alpine AS build
# install build dependencies
RUN apk add --no-cache build-base npm git python
# prepare build dir
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV
ENV MIX_ENV=prod
ENV SECRET_KEY_BASE=OiHyw9mIm05syvuSnZTwY0TrpQHh1GPFwZN2EbswJzNRYNPXvs4y61IlRz5OvvXl
# install mix dependencies
COPY . ./
RUN mix do deps.get, deps.compile
# build assets
RUN npm --prefix ./assets ci --progress=false --no-audit
RUN npm run --prefix ./assets/ deploy
RUN mix phx.digest
RUN mix do compile, release
# prepare release image
FROM alpine:3.12 AS app
RUN apk add --no-cache openssl ncurses-libs
WORKDIR /app
RUN chown nobody:nobody /app
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/phoenix_sample ./
ENV HOME=/app
EXPOSE 80
CMD ["bin/phoenix_sample", "start"]