root: move docker files to lifecycle/containers and change docker-compose to compose (#16624)

This commit is contained in:
Connor Peshek
2025-12-18 18:23:54 -06:00
committed by GitHub
parent 59460ac840
commit 646a0d3692
32 changed files with 56 additions and 67 deletions

View File

@@ -77,5 +77,5 @@ base = {
},
}
with open("docker-compose.yml", "w") as _compose:
with open("lifecycle/container/compose.yml", "w") as _compose:
safe_dump(base, _compose)

View File

@@ -5,29 +5,29 @@ hash="$(git rev-parse HEAD || openssl rand -base64 36 | sha256sum)"
AUTHENTIK_IMAGE="xghcr.io/goauthentik/server"
AUTHENTIK_TAG="$(echo "$hash" | cut -c1-15)"
if [ -f .env ]; then
if [ -f lifecycle/container/.env ]; then
echo "Existing .env file, aborting"
exit 1
fi
echo PG_PASS="$(openssl rand -base64 36 | tr -d '\n')" >.env
echo AUTHENTIK_SECRET_KEY="$(openssl rand -base64 60 | tr -d '\n')" >>.env
echo PG_PASS="$(openssl rand -base64 36 | tr -d '\n')" >lifecycle/container/.env
echo AUTHENTIK_SECRET_KEY="$(openssl rand -base64 60 | tr -d '\n')" >>lifecycle/container/.env
export COMPOSE_PROJECT_NAME="authentik-test-${AUTHENTIK_TAG}"
if [[ -v BUILD ]]; then
echo AUTHENTIK_IMAGE="${AUTHENTIK_IMAGE}" >>.env
echo AUTHENTIK_TAG="${AUTHENTIK_TAG}" >>.env
echo AUTHENTIK_IMAGE="${AUTHENTIK_IMAGE}" >>lifecycle/container/.env
echo AUTHENTIK_TAG="${AUTHENTIK_TAG}" >>lifecycle/container/.env
# Ensure buildx is installed
docker buildx install
# For release builds we have an empty client here as we use the NPM package
mkdir -p ./gen-ts-api
touch .env
touch lifecycle/container/.env
docker build -t "${AUTHENTIK_IMAGE}:${AUTHENTIK_TAG}" .
fi
docker compose up --no-start
docker compose start postgresql
docker compose run -u root server test-all
docker compose down -v
docker compose -f lifecycle/container/compose.yml up --no-start
docker compose -f lifecycle/container/compose.yml start postgresql
docker compose -f lifecycle/container/compose.yml run -u root server test-all
docker compose -f lifecycle/container/compose.yml down -v