S16 postgresql opslag added
All checks were successful
Build, test and publish / verify (push) Successful in 7m31s
All checks were successful
Build, test and publish / verify (push) Successful in 7m31s
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
# Images are resolved to registry digests before replacement. Never use :main here.
|
||||
services:
|
||||
database:
|
||||
image: postgres:17.6
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: agiledancers
|
||||
POSTGRES_USER: agiledancers
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:?Required database password}
|
||||
volumes:
|
||||
- database-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'pg_isready -U agiledancers -d agiledancers']
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
backend:
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: jdbc:postgresql://database:5432/agiledancers
|
||||
DATABASE_USER: agiledancers
|
||||
DATABASE_PASSWORD: ${DATABASE_PASSWORD:?Required database password}
|
||||
image: ${BACKEND_IMAGE:?Required verified backend digest}
|
||||
platform: linux/amd64
|
||||
restart: unless-stopped
|
||||
@@ -32,3 +53,7 @@ services:
|
||||
options:
|
||||
max-size: '10m'
|
||||
max-file: '3'
|
||||
|
||||
volumes:
|
||||
database-data:
|
||||
name: agiledancers-production-database
|
||||
|
||||
@@ -7,3 +7,6 @@ DOCKER_BIN=/usr/local/bin/docker
|
||||
DOCKER_SUDO=1
|
||||
# The pull-only registry login is provisioned separately using docker login.
|
||||
DOCKER_CONFIG=/volume1/docker/agiledancers-production/docker-auth
|
||||
|
||||
# Set a long random password before the first S16 deployment. Never commit its real value.
|
||||
DATABASE_PASSWORD=replace-with-a-long-random-password
|
||||
|
||||
@@ -65,6 +65,8 @@ test -f production.env || die 'Missing production.env; follow provisioning runbo
|
||||
. "$root/production.env"
|
||||
: "${BIND_IP:?}" "${FRONTEND_PORT:?}" "${DOCKER_BIN:?}" "${DOCKER_CONFIG:?}"
|
||||
export DOCKER_CONFIG
|
||||
# Compose expands database credentials from trusted production.env, never release metadata.
|
||||
if [ -n "${DATABASE_PASSWORD:-}" ]; then export DATABASE_PASSWORD; fi
|
||||
docker_cmd() {
|
||||
if [ "${DOCKER_SUDO:-1}" = 1 ]; then
|
||||
sudo -n "$DOCKER_BIN" --config "$DOCKER_CONFIG" "$@"
|
||||
@@ -170,7 +172,9 @@ case "$action" in
|
||||
test "$health_seconds" -ge 1 && test "$health_seconds" -le 280 || die 'Invalid readiness window'
|
||||
end=$(( $(date +%s) + health_seconds ))
|
||||
# Always recreate the frontend too: nginx must resolve the new backend IP.
|
||||
compose up -d --no-build --pull never --force-recreate --timeout 20
|
||||
# Recreate application containers only; the database and volume survive releases.
|
||||
compose up -d --no-build --pull missing --timeout 20 database
|
||||
compose up -d --no-deps --no-build --pull never --force-recreate --timeout 20 backend frontend
|
||||
while ! health; do
|
||||
test "$(date +%s)" -lt "$end" || die 'Readiness checks timed out'
|
||||
sleep 1
|
||||
|
||||
Reference in New Issue
Block a user