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
version: '3' | |
services: | |
mysql: | |
image: mysql:5.7 | |
ports: | |
- "3306:3306" | |
command: "mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci" | |
volumes: | |
- mysql-dataset:/var/lib/mysql |
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
version: '3' | |
services: | |
openldap: | |
image: osixia/openldap:1.3.0 | |
ports: | |
- '389:389' | |
- '636:636' | |
phpldapadmin: |
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
version: '3' | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- "5432:5432" | |
volumes: | |
- pg-dataset:/var/lib/postgresql/data | |
environment: |
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
defmodule BaseCalculator do | |
@moduledoc """ | |
Define the base calculator and provide public API. | |
Define the callback to implement specific logic in child module. | |
""" | |
# it should be implemented by child module | |
@callback do_calculate(num1 :: Integer.t(), num2 :: Integer.t()) :: {:ok, Integer.t()} | {:error, any()} | |
defmacro __using__(_opts) do |
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
## .... | |
environment :prod do | |
set include_erts: true | |
set include_src: false | |
set cookie: :"8[^a{lsZs|em/)Xg^pI}m2hXlmbzuuioM|[6mB6Pbno9MFuzWCNN{9TvK}(%]D<S" | |
set vm_args: "rel/vm.args" | |
set pre_start_hooks: "rel/hooks/pre_start" | |
set post_start_hooks: "rel/hooks/post_start" | |
end |
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
#!/usr/bin/env bash | |
### Comment below block if it's a command ### | |
set +e | |
while true; do | |
nodetool ping | |
EXIT_CODE=$? | |
if [[ ${EXIT_CODE} -eq 0 ]]; then | |
echo "Application is up!" |
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
#!/usr/bin/env bash | |
echo "Running database creation" | |
bin/dockerize_elixir command Elixir.Release.Tasks create_db | |
echo "DB created successfully" |
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
defmodule Release.Tasks do | |
@start_apps [ | |
:postgrex, | |
:ecto, | |
:ecto_sql | |
] | |
@app_mods [ | |
DockerizeElixir | |
] |
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
$ docker build --build-arg APP_NAME=dockerize_elixir --build-arg APP_VSN=0.1.0 --build-arg SKIP_PHOENIX=true -t app:0.1.0 . |
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
# The version of Alpine to use for the final image | |
# This should match the version of Alpine that the `elixir:1.7.2-alpine` image uses | |
ARG ALPINE_VERSION=3.8 | |
FROM elixir:1.7.2-alpine AS builder | |
# The following are build arguments used to change variable parts of the image. | |
# The name of your application/release (required) | |
ARG APP_NAME | |
# The version of the application we are building (required) |
NewerOlder