1 FROM elixir:1.13.4-alpine as build
7 RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
8 echo "import Config" > config/prod.secret.exs &&\
9 mix local.hex --force &&\
10 mix local.rebar --force &&\
11 mix deps.get --only prod &&\
13 mix release --path release
20 LABEL org.opencontainers.image.title="akkoma" \
21 org.opencontainers.image.description="Akkoma for Docker" \
22 org.opencontainers.image.vendor="akkoma.dev" \
23 org.opencontainers.image.documentation="https://docs.akkoma.dev/stable/" \
24 org.opencontainers.image.licenses="AGPL-3.0" \
25 org.opencontainers.image.url="https://akkoma.dev" \
26 org.opencontainers.image.revision=$VCS_REF \
27 org.opencontainers.image.created=$BUILD_DATE
30 ARG DATA=/var/lib/akkoma
33 apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
34 adduser --system --shell /bin/false --home ${HOME} akkoma &&\
35 mkdir -p ${DATA}/uploads &&\
36 mkdir -p ${DATA}/static &&\
37 chown -R akkoma ${DATA} &&\
38 mkdir -p /etc/akkoma &&\
39 chown -R akkoma /etc/akkoma
43 COPY --from=build --chown=akkoma:0 /release ${HOME}
45 COPY ./config/docker.exs /etc/akkoma/config.exs
46 COPY ./docker-entrypoint.sh ${HOME}
50 ENTRYPOINT ["/opt/akkoma/docker-entrypoint.sh"]