mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 23:11:13 +00:00
c86db959cb
Just merging RUNs to decrease the number of layers
40 lines
957 B
Docker
40 lines
957 B
Docker
FROM rinpatch/elixir:1.9.0-rc.0-alpine as build
|
|
|
|
COPY . .
|
|
|
|
ENV MIX_ENV=prod
|
|
|
|
RUN apk add git gcc g++ musl-dev make &&\
|
|
echo "import Mix.Config" > config/prod.secret.exs &&\
|
|
mix local.hex --force &&\
|
|
mix local.rebar --force &&\
|
|
mix deps.get --only prod &&\
|
|
mkdir release &&\
|
|
mix release --path release
|
|
|
|
FROM alpine:latest
|
|
|
|
ARG HOME=/opt/pleroma
|
|
ARG DATA=/var/lib/pleroma
|
|
|
|
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
|
apk update &&\
|
|
apk add ncurses postgresql-client &&\
|
|
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
|
mkdir -p ${DATA}/uploads &&\
|
|
mkdir -p ${DATA}/static &&\
|
|
chown -R pleroma ${DATA} &&\
|
|
mkdir -p /etc/pleroma &&\
|
|
chown -R pleroma /etc/pleroma
|
|
|
|
USER pleroma
|
|
|
|
COPY --from=build --chown=pleroma:0 /release ${HOME}
|
|
|
|
COPY ./config/docker.exs /etc/pleroma/config.exs
|
|
COPY ./docker-entrypoint.sh ${HOME}
|
|
|
|
EXPOSE 4000
|
|
|
|
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]
|