Optimize Dockerfile

Just merging RUNs to decrease the number of layers
This commit is contained in:
Ashlynn Anderson 2019-08-02 22:40:31 -04:00
parent 4a418698db
commit c86db959cb

View File

@ -7,9 +7,8 @@ ENV MIX_ENV=prod
RUN apk add git gcc g++ musl-dev make &&\ RUN apk add git gcc g++ musl-dev make &&\
echo "import Mix.Config" > config/prod.secret.exs &&\ echo "import Mix.Config" > config/prod.secret.exs &&\
mix local.hex --force &&\ mix local.hex --force &&\
mix local.rebar --force mix local.rebar --force &&\
mix deps.get --only prod &&\
RUN mix deps.get --only prod &&\
mkdir release &&\ mkdir release &&\
mix release --path release mix release --path release
@ -20,9 +19,8 @@ ARG DATA=/var/lib/pleroma
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\ RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
apk update &&\ apk update &&\
apk add ncurses postgresql-client apk add ncurses postgresql-client &&\
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
RUN adduser --system --shell /bin/false --home ${HOME} pleroma &&\
mkdir -p ${DATA}/uploads &&\ mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\ mkdir -p ${DATA}/static &&\
chown -R pleroma ${DATA} &&\ chown -R pleroma ${DATA} &&\