2024-05-28 12:12:38 +01:00
|
|
|
####################################
|
|
|
|
# BUILD CONTAINER
|
|
|
|
####################################
|
|
|
|
|
|
|
|
FROM hexpm/elixir:1.16.3-erlang-26.2.5-alpine-3.19.1 AS BUILD
|
2019-08-01 00:35:14 +01:00
|
|
|
|
2019-08-03 03:28:48 +01:00
|
|
|
ENV MIX_ENV=prod
|
2019-08-01 00:35:14 +01:00
|
|
|
|
2024-05-28 12:12:38 +01:00
|
|
|
RUN mkdir /src
|
|
|
|
WORKDIR /src
|
|
|
|
RUN apk add git gcc g++ musl-dev make cmake file-dev exiftool ffmpeg imagemagick libmagic ncurses postgresql-client
|
|
|
|
RUN mix local.hex --force &&\
|
|
|
|
mix local.rebar --force
|
|
|
|
|
|
|
|
ADD mix.exs /src/mix.exs
|
|
|
|
ADD mix.lock /src/mix.lock
|
|
|
|
ADD lib/ /src/lib/
|
|
|
|
ADD priv/ /src/priv/
|
|
|
|
ADD config/ /src/config/
|
|
|
|
ADD rel/ /src/rel/
|
|
|
|
ADD restarter/ /src/restarter/
|
|
|
|
ADD docs/ /src/docs/
|
|
|
|
ADD installation/ /src/installation/
|
|
|
|
|
|
|
|
RUN mix deps.get --only=prod
|
|
|
|
RUN mix release --path docker-release
|
|
|
|
|
|
|
|
#################################
|
|
|
|
# RUNTIME CONTAINER
|
|
|
|
#################################
|
|
|
|
|
|
|
|
FROM alpine:3.19.1
|
|
|
|
|
|
|
|
RUN apk add file-dev exiftool ffmpeg imagemagick libmagic postgresql-client
|
2020-01-10 19:09:14 +00:00
|
|
|
|
2022-07-18 11:17:24 +01:00
|
|
|
LABEL org.opencontainers.image.title="akkoma" \
|
|
|
|
org.opencontainers.image.description="Akkoma for Docker" \
|
|
|
|
org.opencontainers.image.vendor="akkoma.dev" \
|
|
|
|
org.opencontainers.image.documentation="https://docs.akkoma.dev/stable/" \
|
2020-01-10 19:09:14 +00:00
|
|
|
org.opencontainers.image.licenses="AGPL-3.0" \
|
2022-07-18 11:17:24 +01:00
|
|
|
org.opencontainers.image.url="https://akkoma.dev" \
|
2020-01-10 19:09:14 +00:00
|
|
|
org.opencontainers.image.revision=$VCS_REF \
|
|
|
|
org.opencontainers.image.created=$BUILD_DATE
|
|
|
|
|
2024-05-28 12:12:38 +01:00
|
|
|
ARG HOME=/opt/akkoma
|
2022-10-16 20:25:54 +01:00
|
|
|
EXPOSE 4000
|
2019-08-01 00:35:14 +01:00
|
|
|
|
2022-10-16 20:25:54 +01:00
|
|
|
WORKDIR /opt/akkoma
|
2019-08-03 03:28:48 +01:00
|
|
|
|
2024-05-28 12:12:38 +01:00
|
|
|
COPY --from=BUILD /src/docker-release/ $HOME
|
|
|
|
RUN ln -s $HOME/bin/pleroma /bin/pleroma
|
|
|
|
# it's nice you know
|
|
|
|
RUN ln -s $HOME/bin/pleroma /bin/akkoma
|
|
|
|
RUN ln -s $HOME/bin/pleroma_ctl /bin/pleroma_ctl
|
|
|
|
RUN ln -s $HOME/bin/pleroma_ctl /bin/akkoma_ctl
|
|
|
|
|
2024-05-29 05:36:52 +01:00
|
|
|
RUN mkdir -p /etc/akkoma
|
|
|
|
|
2024-05-28 12:12:38 +01:00
|
|
|
ADD docker-entrypoint.sh $HOME/docker-entrypoint.sh
|
|
|
|
|
2024-06-01 08:29:44 +01:00
|
|
|
RUN adduser --system --home /opt/akkoma akkoma
|
|
|
|
USER akkoma
|
2019-08-03 03:28:48 +01:00
|
|
|
|
2024-05-29 06:07:35 +01:00
|
|
|
VOLUME uploads /opt/akkoma/uploads
|
|
|
|
VOLUME instance /opt/akkoma/instance
|
|
|
|
VOLUME config /etc/akkoma/config.exs
|
|
|
|
|
2022-10-16 20:25:54 +01:00
|
|
|
CMD ["/opt/akkoma/docker-entrypoint.sh"]
|