blob: 43de07d7e77c7090030db8a6413f1f1123442102 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
repo_dir="$(cd -- "$script_dir/.." && pwd)"
env_file="${AIGW_DEBUG_ENV_FILE:-$repo_dir/.env.debug}"
command -v docker >/dev/null 2>&1 || {
printf '[aigw-debug] error: docker is not installed\n' >&2
exit 1
}
if [[ -f "$env_file" ]]; then
compose=(docker compose --env-file "$env_file")
else
export AIGW_SERVER_ADDRESS=:8080
export AIGW_POSTGRES_USER=debug-stop-placeholder
export AIGW_POSTGRES_PASSWORD=debug-stop-placeholder
export AIGW_POSTGRES_DB=debug-stop-placeholder
export AIGW_DATABASE_URL_DOCKER=postgres://debug-stop-placeholder:debug-stop-placeholder@postgres:5432/debug-stop-placeholder
export AIGW_REDIS_URL_DOCKER=
export AIGW_CREDENTIAL_KEY=debug-stop-placeholder
export AIGW_ADMIN_TOKEN=debug-stop-placeholder
export AIGW_STRIPE_API_KEY=debug-stop-placeholder
export AIGW_STRIPE_WEBHOOK_SECRET=debug-stop-placeholder
export AIGW_STRIPE_SUCCESS_URL=http://127.0.0.1:8080/admin/?topup=success
export AIGW_STRIPE_CANCEL_URL=http://127.0.0.1:8080/admin/?topup=cancel
compose=(docker compose)
fi
cd "$repo_dir"
printf '[aigw-debug] stopping services\n'
"${compose[@]}" down --remove-orphans
printf '[aigw-debug] stopped; PostgreSQL and Redis volumes were preserved\n'
|