-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
69 lines (52 loc) · 2.24 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
65
66
67
68
69
FROM hexpm/elixir:1.15.4-erlang-26.0.2-alpine-3.18.2 as build
COPY . .
ENV MIX_ENV=prod
ENV ERL_EPMD_ADDRESS=127.0.0.1
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
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:3.17.2
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="ops@akkoma.social" \
org.opencontainers.image.title="akkoma" \
org.opencontainers.image.description="akkoma for Docker" \
org.opencontainers.image.authors="ops@akkoma.social" \
org.opencontainers.image.vendor="akkoma.social" \
org.opencontainers.image.documentation="https://git.akkoma.social/akkoma/akkoma" \
org.opencontainers.image.licenses="AGPL-3.0" \
org.opencontainers.image.url="https://akkoma.social" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE
ARG HOME=/opt/akkoma
ARG DATA=/var/lib/akkoma
RUN apk update &&\
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client curl unzip &&\
adduser --system --shell /bin/false --home ${HOME} akkoma &&\
mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\
chown -R akkoma ${DATA} &&\
mkdir -p /etc/akkoma
COPY ./config/docker.exs /etc/akkoma/config.exs
RUN chown -R akkoma /etc/akkoma &&\
chmod o-rwx /etc/akkoma/config.exs
USER akkoma
COPY --from=build --chown=akkoma:0 /release ${HOME}
COPY ./docker-entrypoint.sh ${HOME}
COPY ./config/frontends.exs $DATA/config.exs
RUN curl -L https://github.com/BDX-town/Mangane/releases/latest/download/static.zip --output ${DATA}/static.zip &&\
mkdir -p ${DATA}/static/frontends/mangane &&\
unzip -d ${DATA}/static/frontends/mangane ${DATA}/static.zip &&\
rm ${DATA}/static.zip
RUN curl -L https://akkoma-updates.s3-website.fr-par.scw.cloud/frontend/stable/admin-fe.zip --output ${DATA}/static.zip &&\
mkdir -p ${DATA}/static/frontends/admin-fe &&\
unzip -d ${DATA}/static/frontends/admin-fe ${DATA}/static.zip &&\
mv ${DATA}/static/frontends/admin-fe/dist ${DATA}/static/frontends/admin-fe/stable &&\
rm ${DATA}/static.zip
COPY ./compress-uploads.sh $DATA/compress-uploads.sh
EXPOSE 4000
ENTRYPOINT ["/opt/akkoma/docker-entrypoint.sh"]