generated from Tamarou/gotosocial-render
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (46 loc) · 2.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM hexpm/elixir:1.14.2-erlang-25.0.4-alpine-3.17.0 as builder
ENV MIX_ENV=prod
ARG BRANCH=stable
RUN apk update \
&& apk add git gcc g++ musl-dev make cmake file-dev
RUN git clone -b "${BRANCH}" --depth=1 https://akkoma.dev/AkkomaGang/akkoma.git
WORKDIR /akkoma
COPY ./prod.secret.exs config/prod.secret.exs
RUN mix local.hex --force &&\
mix local.rebar --force &&\
mix deps.get --only ${MIX_ENV} &&\
mkdir release &&\
mix release --path release
FROM alpine:3.17.0 as final
ENV UID=911 GID=911
ARG HOME=/opt/akkoma
ARG DATA=/var/lib/akkoma
RUN addgroup -g ${GID} akkoma &&\
adduser --system --shell /bin/false --home ${HOME} -D -G akkoma -u ${UID} akkoma
RUN apk update &&\
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client su-exec shadow curl &&\
mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\
chown -R akkoma:akkoma ${DATA} &&\
mkdir -p ${HOME}/config &&\
chown -R akkoma:akkoma ${HOME} &&\
mkdir -p /etc/akkoma &&\
chown -R akkoma:akkoma /etc/akkoma
USER akkoma
COPY --from=builder --chown=akkoma /akkoma/config/docker.exs /etc/akkoma/config.exs
COPY --from=builder --chown=akkoma /akkoma/config/prod.secret.exs ${HOME}/config/prod.secret.exs
COPY --from=builder --chown=akkoma /akkoma/release ${HOME}
COPY --chown=akkoma docker-entrypoint.sh ${HOME}
#COPY --chown=akkoma favicon.png ${DATA}/frontends/favicon.png
RUN curl -L https://akkoma-updates.s3-website.fr-par.scw.cloud/frontend/stable/admin-fe.zip --output ${DATA}/admin-fe.zip &&\
mkdir -p ${DATA}/static/frontends/admin-fe &&\
unzip -d ${DATA}/static/frontends/admin-fe ${DATA}/admin-fe.zip &&\
mv ${DATA}/static/frontends/admin-fe/dist ${DATA}/static/frontends/admin-fe/stable &&\
rm ${DATA}/admin-fe.zip
RUN curl -L https://akkoma-updates.s3-website.fr-par.scw.cloud/frontend/stable/akkoma-fe.zip --output ${DATA}/akkoma-fe.zip &&\
mkdir -p ${DATA}/static/frontends/pleroma-fe &&\
unzip -d ${DATA}/static/frontends/pleroma-fe ${DATA}/akkoma-fe.zip &&\
mv ${DATA}/static/frontends/pleroma-fe/dist ${DATA}/static/frontends/pleroma-fe/stable &&\
rm ${DATA}/akkoma-fe.zip
EXPOSE 4000
ENTRYPOINT ["/opt/akkoma/docker-entrypoint.sh"]