Compare commits

...

10 commits

5 changed files with 31 additions and 16 deletions

View file

@ -1,3 +1,4 @@
* *
!.git
!akkoma !akkoma
!prod.exs !prod.exs

6
.gitmodules vendored
View file

@ -1,6 +0,0 @@
[submodule "src"]
path = src
url = https://akkoma.dev/AkkomaGang/akkoma.git
[submodule "akkoma"]
path = akkoma
url = https://akkoma.dev/AkkomaGang/akkoma.git

View file

@ -3,14 +3,22 @@ FROM registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}
ENV PROD_SECRET_FILE=/config/prod.secret.exs ENV PROD_SECRET_FILE=/config/prod.secret.exs
ADD akkoma /opt/akkoma/
ADD prod.exs /opt/akkoma/config/prod.exs
USER root USER root
RUN mkdir /config && touch /config/prod.secret.exs && chown -R 1000:1000 /opt/akkoma && chown -R 1000:1000 /config RUN mkdir -p "$(dirname "${PROD_SECRET_FILE}")" && \
touch "${PROD_SECRET_FILE}" && \
chown -R 1000:1000 "$(dirname "${PROD_SECRET_FILE}")" && \
rm -rf /opt/akkoma && \
cd /opt && \
git clone https://akkoma.dev/AkkomaGang/akkoma.git akkoma && \
chown -R akkoma: /opt/akkoma
ADD --chown=akkoma:akkoma prod.exs /opt/akkoma/config/prod.exs
USER akkoma USER akkoma
RUN mix deps.get && \ WORKDIR /opt/akkoma
mix compile && \ RUN git fetch --all && git checkout $AKKOMA_COMMIT
mix pleroma.frontend install pleroma-fe --ref stable && \ RUN mix local.hex --force && mix local.rebar --force
mix pleroma.frontend install admin-fe --ref stable RUN mix deps.get
RUN mix compile
RUN mix pleroma.frontend install pleroma-fe --ref stable
RUN mix pleroma.frontend install admin-fe --ref stable

1
akkoma

@ -1 +0,0 @@
Subproject commit 9d7c877de049303a4d4d8f5ecaac7da94ca59ebb

View file

@ -1,18 +1,31 @@
#!/bin/bash #!/bin/bash
set -Eeuxo pipefail set -Eeuxo pipefail
AKKOMA_COMMIT=$(cd akkoma; git rev-parse HEAD) AKKOMA_COMMIT="9d7c877de049303a4d4d8f5ecaac7da94ca59ebb"
LOCAL_COMMIT=$(git rev-parse HEAD) LOCAL_COMMIT=$(git rev-parse HEAD)
AKKOMA_BASE_IMAGE="registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}" AKKOMA_BASE_IMAGE="registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}"
AKKOMA_FINAL_IMAGE="registry.nrd.li/nrdli/akkoma:${LOCAL_COMMIT}" AKKOMA_FINAL_IMAGE="registry.nrd.li/nrdli/akkoma:${LOCAL_COMMIT}"
# clone akkoma source code
if [ -d akkoma ]; then
rm -rf akkoma
fi
git clone https://akkoma.dev/AkkomaGang/akkoma.git akkoma
pushd akkoma pushd akkoma
git fetch --all
git checkout "${AKKOMA_COMMIT}"
if [ "$(git rev-parse HEAD)" != "${AKKOMA_COMMIT}" ]; then
exit 1
fi
# build and store base image
docker build \ docker build \
-t "${AKKOMA_BASE_IMAGE}" \ -t "${AKKOMA_BASE_IMAGE}" \
. .
docker push "${AKKOMA_BASE_IMAGE}" docker push "${AKKOMA_BASE_IMAGE}"
popd popd
# run install steps for akkoma
docker build \ docker build \
-t "${AKKOMA_FINAL_IMAGE}" \ -t "${AKKOMA_FINAL_IMAGE}" \
--build-arg "AKKOMA_COMMIT=${AKKOMA_COMMIT}" \ --build-arg "AKKOMA_COMMIT=${AKKOMA_COMMIT}" \