From 240237fa3b91176b6798b5348411bcbebc6f4f10 Mon Sep 17 00:00:00 2001 From: pleroma Date: Sat, 2 Sep 2023 23:39:40 -0700 Subject: [PATCH] rebaseded --- Dockerfile | 56 +++++++++++++++++++++++++++ ap | 1 + config/.prod.secret.exs.un~ | Bin 0 -> 3291 bytes docker-entrypoint.sh | 14 +++++++ static/.robots.txt.un~ | Bin 0 -> 982 bytes static/static/terms-of-service.html~ | 1 + 6 files changed, 72 insertions(+) create mode 100644 Dockerfile mode change 100644 => 120000 ap create mode 100644 config/.prod.secret.exs.un~ create mode 100755 docker-entrypoint.sh create mode 100755 static/.robots.txt.un~ create mode 100755 static/static/terms-of-service.html~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c3ff3a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,56 @@ +ARG ELIXIR_VER=1.11.4 +ARG ERLANG_VER=24.2.1 +ARG ALPINE_VER=3.17.0 + +FROM hexpm/elixir:${ELIXIR_VER}-erlang-${ERLANG_VER}-alpine-${ALPINE_VER} as build + +COPY . . + +ENV MIX_ENV=prod + +RUN apk add git gcc g++ musl-dev make cmake file-dev &&\ + echo "import 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:${ALPINE_VER} + +ARG BUILD_DATE +ARG VCS_REF + +LABEL maintainer="ops@pleroma.social" \ + org.opencontainers.image.title="pleroma" \ + org.opencontainers.image.description="Pleroma for Docker" \ + org.opencontainers.image.authors="ops@pleroma.social" \ + org.opencontainers.image.vendor="pleroma.social" \ + org.opencontainers.image.documentation="https://git.pleroma.social/pleroma/pleroma" \ + org.opencontainers.image.licenses="AGPL-3.0" \ + org.opencontainers.image.url="https://pleroma.social" \ + org.opencontainers.image.revision=$VCS_REF \ + org.opencontainers.image.created=$BUILD_DATE + +ARG HOME=/opt/pleroma +ARG DATA=/var/lib/pleroma + +RUN apk update &&\ + apk add exiftool ffmpeg imagemagick libmagic 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"] diff --git a/ap b/ap deleted file mode 100644 index e69de29..0000000 diff --git a/ap b/ap new file mode 120000 index 0000000..4b5268c --- /dev/null +++ b/ap @@ -0,0 +1 @@ +/raid/servers/ap/ \ No newline at end of file diff --git a/config/.prod.secret.exs.un~ b/config/.prod.secret.exs.un~ new file mode 100644 index 0000000000000000000000000000000000000000..0b44d7fedfd48d81529fbd9a5ecfe6f61f730377 GIT binary patch literal 3291 zcmeH}Jxjw-6ozloT31KwV#W>?(JiS( zK8nQ`8LkB8R|W`2&c?ymCpcO(+B7z4LnJ<`kgaP~tx>XgqsUuUjqCMVQdvlB+x+lQ zNQjPD;v)e+AtydgiC^C4Ck^>EDg7iLkKfcNKfPYz=8)fv0}$d13lRe584X*MfdGZf z_%bDcyMh4OfOfeM0EQH$;E)2DF(C+011Z}AQf?;v@Y+%rPn(gbJo&}Z>HZ?Stk*U&+#vR8Zs?VcBUVwUh#!ba z)UjIW?#SvuwKdiq9mR^$zIL_Kt7u^(JLyeZGm%g5U19f<` A7ytkO literal 0 HcmV?d00001 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..4691f68 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/ash + +set -e + +echo "-- Waiting for database..." +while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-pleroma} -t 1; do + sleep 1s +done + +echo "-- Running migrations..." +$HOME/bin/pleroma_ctl migrate + +echo "-- Starting!" +exec $HOME/bin/pleroma start diff --git a/static/.robots.txt.un~ b/static/.robots.txt.un~ new file mode 100755 index 0000000000000000000000000000000000000000..6574351c0986bf9f6eed4ce55e7aedb886191486 GIT binary patch literal 982 zcmWH`%$*;a=aT=Ffyq_4`;&j^bvEyxyj2Yvr)rAz-NG2ROx)7dCw1 literal 0 HcmV?d00001 diff --git a/static/static/terms-of-service.html~ b/static/static/terms-of-service.html~ new file mode 100755 index 0000000..c7d8fa6 --- /dev/null +++ b/static/static/terms-of-service.html~ @@ -0,0 +1 @@ +

Terms of Service

We do not block any instances.

Your allowed to say almost everything as long as its legal in the US(so no fed posts or loli).

@dcc is the BDFL of anni.

We are very moderated

Accounts with no public posts will be purged after one week

\ No newline at end of file -- 2.35.8