Skip to content

Instantly share code, notes, and snippets.

@bitwalker
Created September 2, 2016 15:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bitwalker/3f5fe253f81d9942a29f2bf26084acd5 to your computer and use it in GitHub Desktop.
Save bitwalker/3f5fe253f81d9942a29f2bf26084acd5 to your computer and use it in GitHub Desktop.
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