Skip to content

Instantly share code, notes, and snippets.

@jb3
Created October 5, 2020 10:13
Show Gist options
  • Save jb3/00b8dcca49d890ea615f8f33c36c21aa to your computer and use it in GitHub Desktop.
Save jb3/00b8dcca49d890ea615f8f33c36c21aa to your computer and use it in GitHub Desktop.
FROM elixir:latest AS app_builder
ENV MIX_ENV=prod \
TEST=1 \
LANG=C.UTF-8
RUN mix local.hex --force && \
mix local.rebar --force
RUN mkdir /app
WORKDIR /app
COPY config ./config
COPY lib ./lib
COPY priv ./priv
COPY mix.exs .
COPY mix.lock .
RUN mix deps.get
RUN mix deps.compile
RUN mix release
FROM debian:buster-slim AS app
ENV LANG=C.UTF-8
RUN apt-get update && apt-get install -y openssl
RUN useradd --create-home app
WORKDIR /home/app
COPY --from=app_builder /app/_build .
RUN chown -R app: ./prod
USER app
EXPOSE 80
CMD ["./prod/rel/joe_bot/bin/joe_bot", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment