File tree Expand file tree Collapse file tree 3 files changed +29
-9
lines changed
Expand file tree Collapse file tree 3 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,20 @@ You have 2 ways how to run Postgresus:
22
33# Installation
44
5- 1 ) Install Postgresus via script.
5+ ** 1) Install Postgresus via script.**
6+
67It will:
78- install Docker with Docker Compose
89- write docker-compose.yml config
910- install cron job to start Postgresus on system reboot
1011
12+ To install, run:
13+ ```
14+ apt-get install -y curl && \
15+ curl -sSL https://raw.githubusercontent.com/RostislavDugin/postgresus/refs/heads/main/install-postgresus.sh | bash
16+ ```
1117
12- > apt-get install -y curl
13- > curl -sSL https://raw.githubusercontent.com/rostislavdugin/postgresus/main/install-postgresus.sh | bash
14- > docker-compose up
15-
16- 2 ) Write docker-compose.yml config manually:
18+ ** 2) Write docker-compose.yml config manually:**
1719
1820```
1921version: "3"
@@ -30,8 +32,8 @@ services:
3032 # PostgreSQL ports so it is safe
3133 environment:
3234 - POSTGRES_DB=postgresus
33- - POSTGRES_USER=postgresus
34- - POSTGRES_PASSWORD=postgresus
35+ - POSTGRES_USER=postgres
36+ - POSTGRES_PASSWORD=Q1234567
3537 volumes:
3638 - ./pgdata:/var/lib/postgresql/data
3739 container_name: postgresus-db
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ services:
1414 ports:
1515 - "4005:4005"
1616 depends_on:
17- - postgresus-db
17+ postgresus-db:
18+ condition: service_healthy
19+ restart: unless-stopped
1820
1921 postgresus-db:
2022 image: postgres:17
@@ -29,3 +31,9 @@ services:
2931 container_name: postgresus-db
3032 command: -p 5437
3133 shm_size: 10gb
34+ healthcheck:
35+ test: ["CMD-SHELL", "pg_isready -U postgresus -d postgresus -p 5437"]
36+ interval: 5s
37+ timeout: 5s
38+ retries: 5
39+ restart: unless-stopped
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ services:
5959 image: rostislavdugin/postgresus:latest
6060 ports:
6161 - "4005:4005"
62+ depends_on:
63+ postgresus-db:
64+ condition: service_healthy
65+ restart: unless-stopped
6266
6367 postgresus-db:
6468 image: postgres:17
@@ -73,6 +77,12 @@ services:
7377 container_name: postgresus-db
7478 command: -p 5437
7579 shm_size: 10gb
80+ healthcheck:
81+ test: ["CMD-SHELL", "pg_isready -U postgresus -d postgresus -p 5437"]
82+ interval: 5s
83+ timeout: 5s
84+ retries: 5
85+ restart: unless-stopped
7686EOF
7787log " docker-compose.yml created successfully"
7888
You can’t perform that action at this time.
0 commit comments