Wait for healthy stack before start probod
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -4,7 +4,7 @@ services:
|
|||||||
pull_policy: missing
|
pull_policy: missing
|
||||||
shm_size: "1g"
|
shm_size: "1g"
|
||||||
command: >
|
command: >
|
||||||
postgres -c "shared_buffers=1GB"
|
postgres -c "shared_buffers=256MB"
|
||||||
-c "max_connections=200"
|
-c "max_connections=200"
|
||||||
-c "log_statement=all"
|
-c "log_statement=all"
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ apt-get install -y -qq \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
gnupg \
|
gnupg \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
|
postgresql-client \
|
||||||
unzip
|
unzip
|
||||||
|
|
||||||
if ! command -v docker &>/dev/null; then
|
if ! command -v docker &>/dev/null; then
|
||||||
@@ -178,10 +179,11 @@ Requires=docker.service
|
|||||||
After=docker.service
|
After=docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/workspace
|
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
|
ExecStop=/usr/bin/docker compose -f compose.yaml down
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
@@ -200,6 +202,7 @@ After=probo-stack.service
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=${LIMA_USER}
|
User=${LIMA_USER}
|
||||||
WorkingDirectory=/workspace
|
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
|
ExecStart=/usr/local/bin/gow -r=false run ./cmd/probod -cfg-file /etc/probod/config.yml -format pretty
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3s
|
RestartSec=3s
|
||||||
@@ -213,7 +216,7 @@ cat > /etc/systemd/system/probo-console.service << EOF
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Probo Console Dev Server
|
Description=Probo Console Dev Server
|
||||||
Requires=probo-node-modules.service
|
Requires=probo-node-modules.service
|
||||||
After=probo-node-modules.service
|
After=probo-node-modules.service probod.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
@@ -231,7 +234,7 @@ cat > /etc/systemd/system/probo-trust.service << EOF
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Probo Trust Dev Server
|
Description=Probo Trust Dev Server
|
||||||
Requires=probo-node-modules.service
|
Requires=probo-node-modules.service
|
||||||
After=probo-node-modules.service
|
After=probo-node-modules.service probod.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
Reference in New Issue
Block a user