Compare commits
10 commits
4e90652410
...
33e8897b79
Author | SHA1 | Date | |
---|---|---|---|
Kegan Myers | 33e8897b79 | ||
Kegan Myers | 6ed5dbcbc1 | ||
Kegan Myers | 187106349a | ||
Kegan Myers | 8062c75935 | ||
Kegan Myers | 93f68c4b85 | ||
Kegan Myers | 74e2f335be | ||
Kegan Myers | 06384b9a19 | ||
Kegan Myers | 2389535593 | ||
Kegan Myers | 7ab1ecf787 | ||
Kegan Myers | d867e74ffb |
|
@ -1,3 +1,4 @@
|
||||||
*
|
*
|
||||||
|
!.git
|
||||||
!akkoma
|
!akkoma
|
||||||
!prod.exs
|
!prod.exs
|
||||||
|
|
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -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
|
|
24
Dockerfile
24
Dockerfile
|
@ -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
akkoma
|
@ -1 +0,0 @@
|
||||||
Subproject commit 9d7c877de049303a4d4d8f5ecaac7da94ca59ebb
|
|
15
build.sh
15
build.sh
|
@ -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}" \
|
||||||
|
|
Loading…
Reference in a new issue