feat: add restart-hook

This commit is contained in:
2026-10-21 10:43:08 +03:00
parent 0563ebfb10
commit ab2bbeef83
2 changed files with 23 additions and 0 deletions
+14
View File
@@ -66,6 +66,20 @@ services:
condition: service_completed_successfully
restart: unless-stopped
tools:
profiles: [tools]
build:
dockerfile_inline: |
FROM docker:27.3.1-cli
RUN apk add --no-cache python3 make
WORKDIR /work
image: mtusi-messenger-lab2-tools:dev
environment:
BASE_URL: http://api:8080
volumes:
- .:/work
- /var/run/docker.sock:/var/run/docker.sock
volumes:
pgdata:
secrets:
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
started() {
docker inspect -f '{{.Name}} {{.State.Status}} started={{.State.StartedAt}}' $(docker compose ps -q postgres api)
}
started
docker compose restart postgres api
started