1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-10 17:12:48 +00:00

added docker support

This commit is contained in:
2018-11-06 23:34:34 -06:00
parent 47e365a64b
commit 25f281cb29
11 changed files with 105 additions and 100 deletions

76
Dockerfile Normal file → Executable file
View File

@@ -1,52 +1,36 @@
# TODO: start of a docker file for build on a centos image
FROM quay.io/concur_platform/centos:7.3.1611-4390ad7
MAINTAINER https://github.com/concur/docker-centos-elixir
LABEL Description="Build image with Erlang 20.2 | Elixir 1.5.2"
FROM node:8.12-alpine
ENV LANG=en_US.UTF-8 ELIXIR_VERSION=1.5.2 ERLANG_VERSION=20.2
WORKDIR /root
WORKDIR /home/client
ADD ./client .
RUN npm install
RUN npm run build
RUN yum -y install epel-release && \
yum -y install gcc gcc-c++ glibc-devel make ncurses-devel wget \
openssl-devel autoconf java-1.8.0-openjdk-devel \
git wxBase.x86_64 unzip which && \
yum clean all && \
localedef -i en_US -f UTF-8 en_US.UTF-8
RUN curl -OLS --compressed https://raw.githubusercontent.com/kerl/kerl/master/kerl && \
chmod a+x /root/kerl && \
/root/kerl update releases && \
/root/kerl build $ERLANG_VERSION $ERLANG_VERSION && \
/root/kerl install $ERLANG_VERSION /usr/lib/erlang && \
/root/kerl cleanup all && \
ln -s /usr/lib/erlang/bin/ct_run /usr/bin/ct_run && \
ln -s /usr/lib/erlang/bin/dialyzer /usr/bin/dialyzer && \
ln -s /usr/lib/erlang/bin/epmd /usr/bin/epmd && \
ln -s /usr/lib/erlang/bin/erl /usr/bin/erl && \
ln -s /usr/lib/erlang/bin/erlc /usr/bin/erlc && \
ln -s /usr/lib/erlang/bin/escript /usr/bin/escript && \
ln -s /usr/lib/erlang/bin/run_erl /usr/bin/run_erl && \
ln -s /usr/lib/erlang/bin/start /usr/bin/start && \
ln -s /usr/lib/erlang/bin/start_erl /usr/bin/start_erl && \
ln -s /usr/lib/erlang/bin/to_erl /usr/bin/to_erl && \
ln -s /usr/lib/erlang/bin/typer /usr/bin/typer
FROM elixir:1.7.3-alpine
RUN curl -OLS --compressed https://github.com/elixir-lang/elixir/releases/download/v$ELIXIR_VERSION/Precompiled.zip && \
unzip -o -d /usr/lib/elixir Precompiled.zip && \
rm Precompiled.zip && \
ln -s /usr/lib/elixir/bin/elixir /usr/bin/elixir && \
ln -s /usr/lib/elixir/bin/mix /usr/bin/mix && \
ln -s /usr/lib/elixir/bin/elixirc /usr/bin/elixirc && \
ln -s /usr/lib/elixir/bin/iex /usr/bin/iex && \
mix local.hex --force && \
mix local.rebar --force && \
mix hex.info
WORKDIR /home
# TODO: install yarn
# RUN curl -OLS --compressed https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz && \
# tar xpvf node-v6.10.3-linux-x64.tar.xz && \
# mv /root/node-v6.10.3-linux-x64 /usr/lib/node && \
# ln -s /usr/lib/node/bin/node /usr/bin/node && \
# ln -s /usr/lib/node/bin/npm /usr/bin/npm
ADD . .
COPY --from=0 /home/priv/static /home/priv/static
CMD "/bin/bash"
RUN apk add alpine-sdk
ENV MIX_ENV=prod
ENV REPLACE_OS_VARS=true
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix deps.get
RUN mix deps.compile
RUN mix release --env=prod
FROM alpine:3.8
RUN apk update
RUN apk add bash openssl-dev
ENV REPLACE_OS_VARS=true
WORKDIR /home
COPY --from=1 /home/_build /home/_build