Skip to content

Commit

Permalink
add build-base to final stage, source stage is unecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekupartek committed Apr 11, 2019
1 parent 8fc5e75 commit fd72ca7
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
FROM alpine:latest AS source
FROM elixir:1.7.4-alpine AS build
RUN apk add --no-cache --update \
bash \
ghostscript \
imagemagick \
libcap \
openssl \
sudo \
tini
ENV LANG C.UTF-8
ENV PORT 80
ENV IMAGER_USER nobody
HEALTHCHECK --timeout=5s --interval=10s CMD imager ping
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/imager"]
CMD ["foreground"]

FROM elixir:1.7.3-alpine AS build
RUN apk add --update \
build-base \
git \
libcap-dev \
&& rm -rf /var/cache/apk/*
libcap-dev
ENV MIX_ENV prod
ENV OPTIMIZE true
RUN mkdir /app
Expand All @@ -31,6 +14,21 @@ RUN mix do deps.get, deps.compile
COPY . /app
RUN mix do compile, release --env=prod

FROM source
FROM alpine:latest
MAINTAINER Łukasz Jan Niemier <lukasz.niemier@appunite.com>
RUN apk add --no-cache --update \
build-base \
bash \
ghostscript \
imagemagick \
libcap \
openssl \
sudo \
tini
ENV LANG C.UTF-8
ENV PORT 80
ENV IMAGER_USER nobody
COPY --from=build /app/_build/prod/rel/imager /usr/local
HEALTHCHECK --timeout=5s --interval=10s CMD imager ping
ENTRYPOINT ["tini", "--", "/usr/local/bin/imager"]
CMD ["foreground"]

0 comments on commit fd72ca7

Please sign in to comment.