Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FEATURE (installation): Update installation script with creds and wait until DB initialized

Rostislav Duginf394c9dd346a
diff --git a/README.md b/README.md
index f69de6b9..afe8b662 100644
--- a/README.md
+++ b/README.md
@@ -2,18 +2,20 @@ You have 2 ways how to run Postgresus:
# Installation
-1) Install Postgresus via script.
+**1) Install Postgresus via script.**
+
It will:
- install Docker with Docker Compose
- write docker-compose.yml config
- install cron job to start Postgresus on system reboot
+To install, run:
+```
+apt-get install -y curl && \
+curl -sSL https://raw.githubusercontent.com/RostislavDugin/postgresus/refs/heads/main/install-postgresus.sh | bash
+```
-> apt-get install -y curl
-> curl -sSL https://raw.githubusercontent.com/rostislavdugin/postgresus/main/install-postgresus.sh | bash
-> docker-compose up
-
-2) Write docker-compose.yml config manually:
+**2) Write docker-compose.yml config manually:**
```
version: "3"
@@ -30,8 +32,8 @@ services:
# PostgreSQL ports so it is safe
environment:
- POSTGRES_DB=postgresus
- - POSTGRES_USER=postgresus
- - POSTGRES_PASSWORD=postgresus
+ - POSTGRES_USER=postgres
+ - POSTGRES_PASSWORD=Q1234567
volumes:
- ./pgdata:/var/lib/postgresql/data
container_name: postgresus-db
diff --git a/docker-compose.yml.example b/docker-compose.yml.example
index 341a7f85..ffabb231 100644
--- a/docker-compose.yml.example
+++ b/docker-compose.yml.example
@@ -14,7 +14,9 @@ services:
ports:
- "4005:4005"
depends_on:
- - postgresus-db
+ postgresus-db:
+ condition: service_healthy
+ restart: unless-stopped
postgresus-db:
image: postgres:17
@@ -29,3 +31,9 @@ services:
container_name: postgresus-db
command: -p 5437
shm_size: 10gb
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U postgresus -d postgresus -p 5437"]
+ interval: 5s
+ timeout: 5s
+ retries: 5
+ restart: unless-stopped
diff --git a/install-postgresus.sh b/install-postgresus.sh
index 5cbdebcb..1e86655f 100644
--- a/install-postgresus.sh
+++ b/install-postgresus.sh
@@ -59,6 +59,10 @@ services:
image: rostislavdugin/postgresus:latest
ports:
- "4005:4005"
+ depends_on:
+ postgresus-db:
+ condition: service_healthy
+ restart: unless-stopped
postgresus-db:
image: postgres:17
@@ -73,6 +77,12 @@ services:
container_name: postgresus-db
command: -p 5437
shm_size: 10gb
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U postgresus -d postgresus -p 5437"]
+ interval: 5s
+ timeout: 5s
+ retries: 5
+ restart: unless-stopped
EOF
log "docker-compose.yml created successfully"