template: sample scripts for each function. also reworked the backup script + checked it with actual_server

This commit is contained in:
2026-02-06 03:16:13 -08:00
parent cc8789e1df
commit 8665afbfa3
11 changed files with 655 additions and 32 deletions

View File

@@ -0,0 +1,73 @@
---
services:
example:
image: example/example:latest
container_name: example
pull_policy: always
restart: unless-stopped
ports:
- 127.0.0.1:${PORT}:999999
volumes:
- type: bind
source: ${VOLUME_PATH}
target: /path/to/data/used/by/app
bind:
create_host_path: true
environment:
PUID: ${PUID}
PGID: ${PGID}
user: ${PUID}:${PGID} # remove if running as root
# depends_on:
# postgres:
# condition: service_healthy
# restart: true
# redis:
# condition: service_healthy
# restart: true
postgres:
image: postgres:18
container_name: example-postgres
pull_policy: always
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql
user: ${PUID}:${PGID}
healthcheck:
test: ['CMD-SHELL', 'psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -c "select version();"']
interval: 1s
retries: 5
timeout: 5s
redis:
image: redis:alpine
container_name: example-redis
command: redis-server --save 60 1 --loglevel warning
pull_policy: always
restart: unless-stopped
volumes:
- redis_data:/data
user: ${PUID}:${PGID}
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping | grep PONG']
interval: 1s
retries: 5
timeout: 3s
volumes:
postgres_data:
driver: local
driver_opts:
type: none
o: bind
device: ${VOLUME_PATH}/postgres
redis_data:
driver: local
driver_opts:
type: none
o: bind
device: ${VOLUME_PATH}/redis