From b61364e2ad90acc560680ae23f507ea03c99421b Mon Sep 17 00:00:00 2001 From: Rostislav Dugin Date: Sun, 8 Jun 2025 14:58:33 +0300 Subject: [PATCH] FEATURE (build): Update installation volumes --- README.md | 20 +++++++++++++++++--- docker-compose.yml.example | 6 ++++-- install-postgresus.sh | 8 +++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index afe8b66..31a1dcf 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,18 @@ -You have 2 ways how to run Postgresus: # Installation -**1) Install Postgresus via script.** +You have 2 ways how to run Postgresus: install via script or manually write docker-compose.yml config. + +**1) Install Postgresus via script (recommended, Linux only).** 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 @@ -25,6 +28,10 @@ services: image: rostislavdugin/postgresus:latest ports: - "4005:4005" + depends_on: + postgresus-db: + condition: service_healthy + restart: unless-stopped postgresus-db: image: postgres:17 @@ -36,11 +43,18 @@ services: - POSTGRES_PASSWORD=Q1234567 volumes: - ./pgdata:/var/lib/postgresql/data + - ./postgresus-data:/app/postgresus-data container_name: postgresus-db command: -p 5437 shm_size: 10gb + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres -d postgresus -p 5437"] + interval: 5s + timeout: 5s + retries: 5 + restart: unless-stopped ``` # Usage -Go to http://localhost:4005 to see Postgresus UI \ No newline at end of file +Go to http://localhost:4005 to see Postgresus UI diff --git a/docker-compose.yml.example b/docker-compose.yml.example index ffabb23..8a8884e 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -13,6 +13,8 @@ services: dockerfile: Dockerfile ports: - "4005:4005" + volumes: + - ./postgresus-data:/app/postgresus-data depends_on: postgresus-db: condition: service_healthy @@ -24,8 +26,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/install-postgresus.sh b/install-postgresus.sh index 1e86655..296bafd 100644 --- a/install-postgresus.sh +++ b/install-postgresus.sh @@ -59,6 +59,8 @@ services: image: rostislavdugin/postgresus:latest ports: - "4005:4005" + volumes: + - ./postgresus-data:/app/postgresus-data depends_on: postgresus-db: condition: service_healthy @@ -70,8 +72,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 @@ -106,6 +108,6 @@ log "Cron job configured successfully" log "PostgresUS installation completed successfully!" log "-------------------------------------------" log "To launch immediately:" -log "> cd $INSTALL_DIR && docker-compose up -d" +log "> cd $INSTALL_DIR && docker compose up -d" log "Or reboot system to auto-start via cron" log "Access PostgresUS at: http://localhost:4005" \ No newline at end of file