2019-12-08 02:34:58 +00:00
|
|
|
FROM elixir:1.9-slim as build
|
|
|
|
|
2019-12-16 04:20:21 +00:00
|
|
|
WORKDIR /root/shortnr
|
2019-12-08 02:34:58 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN mix local.hex --force
|
|
|
|
RUN mix local.rebar --force
|
|
|
|
|
|
|
|
RUN env MIX_ENV=prod mix release
|
|
|
|
|
|
|
|
FROM debian:buster-20191014-slim
|
|
|
|
|
|
|
|
WORKDIR /home/shortnr
|
2019-12-26 21:11:43 +00:00
|
|
|
COPY --from=build /root/shortnr/_build/prod/rel/shortnr/ .
|
2019-12-08 02:34:58 +00:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
libtinfo5=6.1+20181013-2+deb10u2 \
|
|
|
|
openssl=1.1.1d-0+deb10u2 \
|
|
|
|
locales=2.28-10 \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
|
|
|
locale-gen
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LANGUAGE en_US:en
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
|
|
|
|
RUN groupadd -r shortnr && useradd --no-log-init -r -g shortnr shortnr
|
|
|
|
RUN chown -R shortnr:shortnr /home/shortnr
|
|
|
|
USER shortnr
|
|
|
|
|
2019-12-26 21:11:43 +00:00
|
|
|
ENTRYPOINT ["bin/shortnr", "start"]
|
2019-12-08 02:34:58 +00:00
|
|
|
EXPOSE 8080
|