Last active
March 12, 2017 03:25
-
-
Save bitwalker/6d807905ce9e43065f0f42a86c0f0526 to your computer and use it in GitHub Desktop.
Example Dockerfile for a release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ | |
REPLACE_OS_VARS=true | |
EXPOSE 5000 | |
WORKDIR ${HOME} | |
RUN \ | |
echo "@edge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ | |
apk --no-cache --update add elixir@edge git && \ | |
mix local.hex --force && \ | |
mix local.rebar --force | |
COPY mix.exs mix.lock ./ | |
RUN mix do deps.get, deps.compile | |
ENV APP_VERSION=0.1.0 | |
COPY . . | |
RUN mix do compile, release --verbose --env=prod && \ | |
mkdir -p /opt/myapp/log && \ | |
cp rel/myapp/releases/$APP_VERSION/myapp.tar.gz /opt/myapp/ && \ | |
cd /opt/myapp && \ | |
tar -xzf myapp.tar.gz && \ | |
rm myapp.tar.gz && \ | |
rm -rf /opt/app/* && \ | |
chmod -R 777 /opt/app && \ | |
chmod -R 777 /opt/myapp | |
WORKDIR /opt/myapp | |
CMD ./bin/myapp foreground |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment