Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Release container image
FROM bitwalker/alpine-erlang:latest
MAINTAINER Paul Schoenfelder <paulschoenfelder@gmail.com>
ENV REFRESHED_AT=2016-06-21 \
HOME=/opt/app/ \
MIX_ENV=prod \
TERM=xterm \
APP=myapp \
APPVER=0.1.0
EXPOSE 5000
WORKDIR ${HOME}
COPY . .
RUN \
echo "@edge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
apk add --no-cache --update --virtual .build-deps \
elixir@edge \
git && \
mix local.hex --force && \
mix local.rebar --force && \
mix do compile, release --verbose --env=prod && \
mkdir -p /opt/$APP/log && \
cp rel/$APP/releases/$APPVER/$APP.tar.gz /opt/$APP/ && \
cd /opt/$APP && \
tar -xzf $APP.tar.gz && \
rm $APP.tar.gz && \
rm -rf $HOME/* && \
apk del .build-deps && \
chmod -R 777 $HOME && \
chmod -R 777 /opt/$APP
WORKDIR /opt/$APP
CMD ./bin/$APP foreground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment