-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from edgurgel/upgrade
Upgrade
- Loading branch information
Showing
57 changed files
with
1,602 additions
and
1,003 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
inputs: [ | ||
"lib/**/*.{ex,exs}", | ||
"test/**/*.{ex,exs}", | ||
"mix.exs" | ||
], | ||
|
||
locals_without_parens: [] | ||
] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
FROM elixir:1.5.2-alpine AS builder | ||
# Based on https://github.com/hexpm/hexpm/blob/08e80ed4fe82b145f6cee1d01da16e162add2a56/Dockerfile | ||
FROM elixir:1.9.0-alpine as build | ||
|
||
ENV APP_NAME poxa | ||
ENV MIX_ENV prod | ||
ENV MIX_ENV=prod | ||
|
||
RUN apk --no-cache add git erlang-xmerl erlang-crypto erlang-sasl | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY . /source | ||
WORKDIR /source | ||
RUN mix local.hex --force && mix local.rebar --force | ||
|
||
RUN mix do \ | ||
local.hex --force, \ | ||
local.rebar --force, \ | ||
deps.get, \ | ||
compile | ||
RUN echo "" > config/poxa.prod.conf | ||
RUN mix release | ||
RUN mkdir -p /app/$APP_NAME | ||
WORKDIR /app/$APP_NAME | ||
RUN tar xzf /source/_build/prod/rel/$APP_NAME/releases/*/$APP_NAME.tar.gz | ||
# install mix dependencies | ||
COPY mix.exs mix.lock ./ | ||
COPY config config | ||
RUN mix deps.get | ||
RUN mix deps.compile | ||
|
||
# build project | ||
COPY priv priv | ||
COPY lib lib | ||
RUN mix compile | ||
|
||
FROM alpine:3.6 | ||
# build release | ||
COPY rel rel | ||
RUN mix release | ||
|
||
ENV APP_NAME poxa | ||
ENV MIX_ENV prod | ||
# prepare release image | ||
FROM alpine:3.9 AS app | ||
RUN apk add --update bash openssl | ||
|
||
RUN apk --no-cache add bash openssl | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app /app | ||
COPY --from=build /app/_build/prod/rel/poxa ./ | ||
RUN chown -R nobody: /app | ||
USER nobody | ||
|
||
CMD /app/$APP_NAME/bin/$APP_NAME foreground | ||
ENV HOME=/app | ||
CMD /app/bin/poxa start |
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
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
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
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
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
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
Oops, something went wrong.