1
0
mirror of https://github.com/erlang/docker-erlang-example.git synced 2025-12-09 13:41:22 +03:00
Files
docker-erlang-example/advanced_examples/minikube-dist/Dockerfile.backend
Kjell Winblad 81c88928de Refactoring: Copy minikube example
This commit copies Lukas Larsson's (@garazdawi) and Siri Hansen's
(@sirihansen) example from:

https://github.com/erlang/docker-erlang-example/tree/minikube-dist
2019-05-20 14:31:47 +02:00

38 lines
750 B
Docker

# Build stage 0
FROM erlang:alpine
# Install Rebar3
RUN mkdir -p /buildroot/rebar3/bin
ADD https://s3.amazonaws.com/rebar3/rebar3 /buildroot/rebar3/bin/rebar3
RUN chmod a+x /buildroot/rebar3/bin/rebar3
# Setup Environment
ENV PATH=/buildroot/rebar3/bin:$PATH
# Reset working directory
WORKDIR /buildroot
# Copy our Erlang test application
COPY backend backend
# And build the release
WORKDIR backend
RUN rebar3 as prod release
# Build stage 1
FROM alpine
# Install some libs
RUN apk add --no-cache openssl && \
apk add --no-cache ncurses-libs
# Install the released application
COPY --from=0 /buildroot/backend/_build/prod/rel/backend /backend
# Expose relevant ports
EXPOSE 8080
EXPOSE 8443
CMD ["/backend/bin/backend", "foreground"]