chore(infra): add env templates and bootstrap script; ignore secrets in git
This commit is contained in:
24
scripts/infra/bootstrap.sh
Normal file
24
scripts/infra/bootstrap.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Create external proxy network if it doesn't exist and prepare Traefik state
|
||||
|
||||
NETWORK_NAME=${TRAEFIK_NETWORK:-proxy}
|
||||
ACME_FILE="infra/core/traefik/data/acme.json"
|
||||
|
||||
echo "[bootstrap] Ensuring external network '${NETWORK_NAME}' exists..."
|
||||
if ! docker network ls --format '{{.Name}}' | grep -qx "${NETWORK_NAME}"; then
|
||||
docker network create "${NETWORK_NAME}"
|
||||
echo "[bootstrap] Created network '${NETWORK_NAME}'."
|
||||
else
|
||||
echo "[bootstrap] Network '${NETWORK_NAME}' already exists."
|
||||
fi
|
||||
|
||||
echo "[bootstrap] Ensuring ACME storage exists with correct permissions..."
|
||||
mkdir -p "$(dirname "${ACME_FILE}")"
|
||||
touch "${ACME_FILE}"
|
||||
chmod 600 "${ACME_FILE}"
|
||||
echo "[bootstrap] ACME storage ready at ${ACME_FILE}."
|
||||
|
||||
echo "[bootstrap] Done."
|
||||
|
||||
Reference in New Issue
Block a user