forked from mtusi2026/mtusi2026lab2
feat: add restart-hook
This commit is contained in:
@@ -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:
|
||||
|
||||
Executable
+9
@@ -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
|
||||
Reference in New Issue
Block a user