День добрый
имеем docker-compose.yml со следующим содержимым
root@mail:~/pgweb# cat docker-compose.yml
services:
pgbackweb:
image: eduardolat/pgbackweb:latest
restart: unless-stopped
ports:
- "8085:8085" # Access the web interface at http://localhost:8085
volumes:
- ./backups:/backups # If you only use S3 destinations, you don't need this volume
environment:
PBW_ENCRYPTION_KEY: "my_secret_key" # Change this to a strong key
PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable"
TZ: "America/Guatemala" # Set your timezone, optional
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pgbackweb
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- ./data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
делаю
root@mail:~/pgweb# docker compose up -d
[+] Running 2/2
✔ Container pgweb-postgres-1 Healthy 5.8s
✔ Container pgweb-pgbackweb-1 Started
контейнеры стратуют , все ок .
задача - запускать контейнеры при перезагрузке (включении после отключения сервака)
добавляю в docker-compose.yml restart: always
services:
pgbackweb:
image: eduardolat/pgbackweb:latest
restart: always
ports:
- "8085:8085" # Access the web interface at http://localhost:8085
volumes:
- ./backups:/backups # If you only use S3 destinations, you don't need this volume
environment:
PBW_ENCRYPTION_KEY: "my_secret_key" # Change this to a strong key
PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable"
TZ: "America/Guatemala" # Set your timezone, optional
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pgbackweb
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- ./data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
ребучу сервер и
root@mail:~/pgweb# docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
root@mail:~/pgweb# docker compose ps -a
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
И беда\печаль контейнеры не стартуют.
Подскажите что не так сделал и как это делать правильно ?