File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -43,31 +43,32 @@ cd elixir/1.9.2/alpine
43
43
Lower final image size by using multistage docker build and avvo/alpine image.
44
44
45
45
``` Dockerfile
46
- FROM avvo/elixir:1.9.2- alpine-otp22 AS build
46
+ FROM avvo/elixir:1.9.4-otp22- alpine-3.9 AS build
47
47
48
48
ENV MIX_ENV=prod
49
49
50
50
COPY . .
51
51
52
- RUN mix do deps.get, deps.compile, compile
53
-
54
52
# If you have assets to build
55
53
RUN cd assets \
56
54
&& npm install \
57
55
&& npm run deploy \
58
- && cd ..
56
+ && cd ../
59
57
60
58
RUN mix phx.digest
61
59
62
- RUN mix release
60
+ RUN mix do deps.get, compile, release
63
61
64
62
FROM avvo/elixir-release:alpine-3.9
65
63
66
64
EXPOSE 4000
67
65
68
66
WORKDIR /srv/app_name
69
67
70
- COPY --from=build ./_build/prod/rel/app_name/ .
68
+ COPY --from=build ./_build/prod/app_name-APP_VERSION.tar.gz .
69
+
70
+ RUN tar zxf app_name-APP_VERSION.tar.gz \
71
+ && rm app_name-APP_VERSION.tar.gz
71
72
72
73
ENTRYPOINT ["avvoenv" , "exec" ]
73
74
CMD ["bin/app_name" , "start" ]
You can’t perform that action at this time.
0 commit comments