init pgsql

This commit is contained in:
2026-08-12 14:20:20 +01:00
parent 43ab0235d4
commit f043b75fd4
2 changed files with 41 additions and 27 deletions
+4 -4
View File
@@ -1,14 +1,14 @@
# pgsql
# PostgreSQL
> One line description of the recipe
> PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
<!-- metadata -->
* **Category**: Apps
* **Status**: 0
* **Image**: [`pgsql`](https://hub.docker.com/r/pgsql), 4, upstream
* **Image**: [`pgautoupgrade/pgautoupgrade`](https://hub.docker.com/r/pgautoupgrade/pgautoupgrade), 4, upstream
* **Healthcheck**: No
* **Backups**: No
* **Backups**: Yes
* **Email**: No
* **Tests**: No
* **SSO**: No
+37 -23
View File
@@ -1,39 +1,53 @@
---
version: "3.8"
services:
app:
image: nginx:1.27.5
pgautoupgrade:
image: pgautoupgrade/pgautoupgrade:18-alpine
networks:
- proxy
environment:
PGHOST: postgres
PGPORT: "5432"
PGDATABASE: postgres
PGUSER_FILE: /run/secrets/pguser
PGPASSWORD_FILE: /run/secrets/pgpassword
secrets:
- pguser
- pgpassword
volumes:
- pgdata:/var/lib/postgresql/data
- pglogs:/var/log/postgresql
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Edit the following line if you are using one, but not both, "Redirect" sections below
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname"
## Redirect from EXTRA_DOMAINS to DOMAIN
# - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)"
# - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}"
# - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true"
## Redirect HTTP to HTTPS
# - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https"
# - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true"
## When you're ready for release, run "abra recipe sync <name>" to set this
- "coop-cloud.${STACK_NAME}.version="
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
# - "backupbot.backup=true"
# - "backupbot.backup.path=/some/path"
- "backupbot.backup=true"
- "backupbot.backup.path=/var/lib/postgresql/data/,/var/log/postgresql/"
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-240}"
- "coop-cloud.${STACK_NAME}.version=18-alpine"
- "traefik.enable=false"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
test: ["CMD-SHELL", "ps -ef | grep -v grep | grep -qi pgautoupgrade || exit 1"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
start_period: 30s
networks:
proxy:
external: true
volumes:
pgdata:
pglogs:
secrets:
pguser:
external: true
name: ${STACK_NAME}_pguser_${SECRET_PGUSER_VERSION}
pgpassword:
external: true
name: ${STACK_NAME}_pgpassword_${SECRET_PGPASSWORD_VERSION}