Wait for healthy stack before start probod

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-28 19:17:40 +04:00
parent dbc5827357
commit 072e9bc4f9
2 changed files with 8 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ services:
pull_policy: missing
shm_size: "1g"
command: >
postgres -c "shared_buffers=1GB"
postgres -c "shared_buffers=256MB"
-c "max_connections=200"
-c "log_statement=all"
ports:

View File

@@ -30,6 +30,7 @@ apt-get install -y -qq \
ca-certificates \
gnupg \
lsb-release \
postgresql-client \
unzip
if ! command -v docker &>/dev/null; then
@@ -178,10 +179,11 @@ Requires=docker.service
After=docker.service
[Service]
Type=simple
Type=oneshot
RemainAfterExit=yes
User=root
WorkingDirectory=/workspace
ExecStart=/usr/bin/docker compose -f compose.yaml up
ExecStart=/usr/bin/docker compose -f compose.yaml up -d --wait
ExecStop=/usr/bin/docker compose -f compose.yaml down
Restart=on-failure
RestartSec=5s
@@ -200,6 +202,7 @@ After=probo-stack.service
Type=simple
User=${LIMA_USER}
WorkingDirectory=/workspace
ExecStartPre=/bin/bash -c 'for i in \$(seq 1 10); do pg_isready -h localhost -p 5432 -U probod -d probod -q && exit 0; sleep 1; done; echo "PostgreSQL not ready after 10s"; exit 1'
ExecStart=/usr/local/bin/gow -r=false run ./cmd/probod -cfg-file /etc/probod/config.yml -format pretty
Restart=on-failure
RestartSec=3s
@@ -213,7 +216,7 @@ cat > /etc/systemd/system/probo-console.service << EOF
[Unit]
Description=Probo Console Dev Server
Requires=probo-node-modules.service
After=probo-node-modules.service
After=probo-node-modules.service probod.service
[Service]
Type=simple
@@ -231,7 +234,7 @@ cat > /etc/systemd/system/probo-trust.service << EOF
[Unit]
Description=Probo Trust Dev Server
Requires=probo-node-modules.service
After=probo-node-modules.service
After=probo-node-modules.service probod.service
[Service]
Type=simple