-
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.
* Add support for env vars
- Loading branch information
Showing
19 changed files
with
124 additions
and
124 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
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,2 +1 @@ | ||
elixir 1.10.4-otp-23 | ||
erlang 23.0 | ||
elixir 1.14.4 |
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,7 @@ | ||
import Config | ||
|
||
# Configures Elixir's Logger | ||
config :logger, :console, | ||
level: :info, | ||
format: "$time $metadata[$level] $message\n", | ||
metadata: :all |
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 |
---|---|---|
|
@@ -6,15 +6,19 @@ services: | |
environment: | ||
- PUID=1000 | ||
- PGID=1000 | ||
- HOME=/app | ||
- TZ=Europe/Berlin | ||
- PUBLIC_KEY=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDg+KMD7QAU+qtH3duwTHmBaJE/WUdiOwC87cqP5cL21 [email protected] | ||
- SUDO_ACCESS=true | ||
- PASSWORD_ACCESS=false | ||
- USER_PASSWORD=password | ||
volumes: | ||
- ./test/fixture/config:/config | ||
- /tmp:/tmp | ||
ports: | ||
- 2222:2222 | ||
control-node: | ||
image: beamx/elixir:1.10.4-otp-23 | ||
image: elixir:1.14.5-otp-24 | ||
container_name: control-node | ||
depends_on: | ||
- openssh-server | ||
|
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,96 +1,23 @@ | ||
FROM linuxserver/openssh-server | ||
# Deprecated, not used anymore but was an attempt to | ||
# - install nix in docker | ||
# - install elixir using nix | ||
# - build elixir service | ||
# The issue is that the build fails to run because the during build the executables generated source their sh path from nix store i.e. | ||
# | ||
# for eg. #!/nix/store/7mbf4p3z7pyvpha1fwv29n1cw0ms65wg-nix-something/sh | ||
# | ||
# so the release tar cannot be deployed to a target host since these paths do not exist there | ||
|
||
# ------------------------------------- | ||
# Erlang (23.0) alpine Dockerfile | ||
# ------------------------------------- | ||
ENV OTP_VERSION="23.1" \ | ||
REBAR3_VERSION="3.14.1" | ||
FROM elixir:1.14.5-otp-24-alpine | ||
|
||
LABEL org.opencontainers.image.version=$OTP_VERSION | ||
RUN curl -L https://nixos.org/nix/install > /tmp/nix.install | ||
|
||
RUN set -xe \ | ||
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz" \ | ||
&& OTP_DOWNLOAD_SHA256="3591903503ea70be3ef1e42abc7a3e1f8af90f2c8989506bf9832175f091e6e5" \ | ||
&& REBAR3_DOWNLOAD_SHA256="b01275b6cbdb354dcf9ed686fce2b5f9dfdd58972ded9e970e31b9215a8521f2" \ | ||
&& apk add --no-cache --virtual .fetch-deps \ | ||
curl \ | ||
ca-certificates \ | ||
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ | ||
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ | ||
&& apk add --no-cache --virtual .build-deps \ | ||
dpkg-dev dpkg \ | ||
gcc \ | ||
g++ \ | ||
libc-dev \ | ||
linux-headers \ | ||
make \ | ||
autoconf \ | ||
ncurses-dev \ | ||
openssl-dev \ | ||
unixodbc-dev \ | ||
lksctp-tools-dev \ | ||
tar \ | ||
&& export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \ | ||
&& mkdir -vp $ERL_TOP \ | ||
&& tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \ | ||
&& rm otp-src.tar.gz \ | ||
&& ( cd $ERL_TOP \ | ||
&& ./otp_build autoconf \ | ||
&& gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \ | ||
&& ./configure --build="$gnuArch" \ | ||
&& make -j$(getconf _NPROCESSORS_ONLN) \ | ||
&& make install ) \ | ||
&& rm -rf $ERL_TOP \ | ||
&& find /usr/local -regex '/usr/local/lib/erlang/\(lib/\|erts-\).*/\(man\|doc\|obj\|c_src\|emacs\|info\|examples\)' | xargs rm -rf \ | ||
&& find /usr/local -name src | xargs -r find | grep -v '\.hrl$' | xargs rm -v || true \ | ||
&& find /usr/local -name src | xargs -r find | xargs rmdir -vp || true \ | ||
&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs -r strip --strip-all \ | ||
&& scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r strip --strip-unneeded \ | ||
&& runDeps="$( \ | ||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ | ||
| tr ',' '\n' \ | ||
| sort -u \ | ||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ | ||
)" \ | ||
&& REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \ | ||
&& curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \ | ||
&& echo "${REBAR3_DOWNLOAD_SHA256} rebar3-src.tar.gz" | sha256sum -c - \ | ||
&& mkdir -p /usr/src/rebar3-src \ | ||
&& tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \ | ||
&& rm rebar3-src.tar.gz \ | ||
&& cd /usr/src/rebar3-src \ | ||
&& HOME=$PWD ./bootstrap \ | ||
&& install -v ./rebar3 /usr/local/bin/ \ | ||
&& rm -rf /usr/src/rebar3-src \ | ||
&& apk add --virtual .erlang-rundeps \ | ||
$runDeps \ | ||
lksctp-tools \ | ||
ca-certificates \ | ||
&& apk del .fetch-deps .build-deps | ||
RUN sh /tmp/nix.install --daemon | ||
|
||
# ------------------------------------- | ||
# ELixir (1.10.4) alpine Dockerfile | ||
# ------------------------------------- | ||
# elixir expects utf8. | ||
ENV ELIXIR_VERSION="v1.10.4" \ | ||
LANG=C.UTF-8 | ||
RUN cp /etc/bashrc /root/.bashrc | ||
|
||
RUN set -xe \ | ||
&& ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ | ||
&& ELIXIR_DOWNLOAD_SHA256="8518c78f43fe36315dbe0d623823c2c1b7a025c114f3f4adbb48e04ef63f1d9f" \ | ||
&& buildDeps=' \ | ||
ca-certificates \ | ||
curl \ | ||
make \ | ||
' \ | ||
&& apk add --no-cache --virtual .build-deps $buildDeps \ | ||
&& curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ | ||
&& echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ | ||
&& mkdir -p /usr/local/src/elixir \ | ||
&& tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ | ||
&& rm elixir-src.tar.gz \ | ||
&& cd /usr/local/src/elixir \ | ||
&& make install clean \ | ||
&& apk del .build-deps | ||
ENV LANG=C.UTF-8 | ||
USER root | ||
RUN /root/.nix-profile/bin/nix-env -iA nixpkgs.elixir_1_14 | ||
|
||
CMD ["iex"] |
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,11 @@ | ||
### How to rebuild service_app | ||
|
||
``` sh | ||
docker run -v ./service_app:/app -it elixir:1.14.5-otp-24-alpine sh | ||
|
||
$ cd /app && MIX_ENV=prod mix release --overwrite | ||
$ exit | ||
|
||
cp service_app/_build/prod/service_app-0.1.0.tar.gz . | ||
sudo rm -rf service_app/_build | ||
``` |
Binary file not shown.
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.