-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
8 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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
FROM elixir:1.6.1 | ||
FROM elixir:1.6.1 AS builder | ||
|
||
LABEL name="slack_quiet" | ||
LABEL version="1.0.0" | ||
LABEL maintainer="[email protected]" | ||
|
||
ARG APP_NAME=slack_quiet | ||
|
||
ENV MIX_ENV=${MIX_ENV:-prod} | ||
ENV REPLACE_OS_VARS=true | ||
|
||
# Install the hex package manager. | ||
RUN mix local.hex --force | ||
|
@@ -24,6 +27,20 @@ RUN mix deps.get --only prod | |
# Bundle app source. | ||
COPY . . | ||
|
||
RUN mix compile | ||
RUN mix do deps.compile, compile | ||
|
||
RUN mix release --env=prod --verbose \ | ||
&& mv _build/prod/rel/${APP_NAME} /opt/release \ | ||
&& mv /opt/release/bin/${APP_NAME} /opt/release/bin/start_server | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk update && apk --no-cache --update add bash openssl-dev | ||
|
||
ENV MIX_ENV=prod REPLACE_OS_VARS=true | ||
|
||
WORKDIR /opt/app | ||
|
||
COPY --from=builder /opt/release . | ||
|
||
CMD ["mix", "phx.server"] | ||
CMD ["/opt/app/bin/start_server", "foreground"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Import all plugins from `rel/plugins` | ||
# They can then be used by adding `plugin MyPlugin` to | ||
# either an environment, or release definition, where | ||
# `MyPlugin` is the name of the plugin module. | ||
Path.join(["rel", "plugins", "*.exs"]) | ||
|> Path.wildcard() | ||
|> Enum.map(&Code.eval_file(&1)) | ||
|
||
use Mix.Releases.Config, | ||
# This sets the default release built by `mix release` | ||
default_release: :default, | ||
# This sets the default environment used by `mix release` | ||
default_environment: Mix.env() | ||
|
||
# For a full list of config options for both releases | ||
# and environments, visit https://hexdocs.pm/distillery/configuration.html | ||
|
||
|
||
# You may define one or more environments in this file, | ||
# an environment's settings will override those of a release | ||
# when building in that environment, this combination of release | ||
# and environment configuration is called a profile | ||
|
||
environment :dev do | ||
# If you are running Phoenix, you should make sure that | ||
# server: true is set and the code reloader is disabled, | ||
# even in dev mode. | ||
# It is recommended that you build with MIX_ENV=prod and pass | ||
# the --env flag to Distillery explicitly if you want to use | ||
# dev mode. | ||
set dev_mode: true | ||
set include_erts: false | ||
set cookie: :"vmyKjbpnM;t^*^AYBupmId*&<W?W*J@[o[qlA$wvO:}M(?&W.B/yMN>93qX5(mLA" | ||
end | ||
|
||
environment :prod do | ||
set include_erts: true | ||
set include_src: false | ||
set cookie: :"j<]RSn.M1W,gD26hRz=_qLnb6)L<^]]w_vyUiAmo8`~`NqdD4;6C`?$/LmkI*2n:" | ||
end | ||
|
||
# You may define one or more releases in this file. | ||
# If you have not set a default release, or selected one | ||
# when running `mix release`, the first release in the file | ||
# will be used by default | ||
|
||
release :slack_quiet do | ||
set version: current_version(:slack_quiet) | ||
set applications: [ | ||
:runtime_tools | ||
] | ||
end | ||
|