diff --git a/Pinepods/.env.example b/Pinepods/.env.example new file mode 100644 index 0000000..228985d --- /dev/null +++ b/Pinepods/.env.example @@ -0,0 +1,55 @@ +# ----------------------------------------------- +# Pinepods - Docker Compose Environment Variables +# ----------------------------------------------- +# Copy this file to .env and fill in your values. + +# ---------------------------- +# App +# ---------------------------- + +# Docker image tag for Pinepods (e.g. "latest" or a pinned version like "0.8.2") +PINEPODS_VERSION=0.8.2 + +# Host port to expose the Pinepods web UI on +PINEPODS_PORT=8044 + +# User and group ID the app process runs as — must own (or have rw on) the downloads and backups NFS exports +PINEPODS_PUID=1000 +PINEPODS_PGID=1000 + +# IANA timezone name for the container (e.g. America/Chicago, America/New_York) +PINEPODS_TZ=America/Los_Angeles + +# Enable extra debug logging (true/false) +PINEPODS_DEBUG_MODE=false + +# ---------------------------- +# Database (PostgreSQL) +# ---------------------------- + +# Postgres image tag +PINEPODS_POSTGRES_VERSION=17.6 + +# Database name and credentials — shared by the app and db services +PINEPODS_DB_NAME=pinepods_database +PINEPODS_DB_USERNAME=postgres +PINEPODS_DB_PASSWORD= + +# ---------------------------- +# Valkey +# ---------------------------- + +# Valkey image tag +PINEPODS_VALKEY_VERSION=8-alpine + +# ---------------------------- +# NFS Volumes +# ---------------------------- + +# IP address or hostname of the NFS server +PINEPODS_NFS_SERVER= + +# NFS export paths for each volume (e.g. :/mnt/pool/pinepods/downloads) +PINEPODS_DOWNLOADS_NFS_DEVICE= +PINEPODS_BACKUPS_NFS_DEVICE= +PINEPODS_DB_NFS_DEVICE= diff --git a/Pinepods/docker-compose-nfs.yaml b/Pinepods/docker-compose-nfs.yaml new file mode 100644 index 0000000..c9fdf1c --- /dev/null +++ b/Pinepods/docker-compose-nfs.yaml @@ -0,0 +1,110 @@ +services: + app: + image: madeofpendletonwool/pinepods:${PINEPODS_VERSION:-0.8.2} + container_name: pinepods-app + ports: + - ${PINEPODS_PORT:-8044}:8040 + environment: + # Basic Server Info + SEARCH_API_URL: 'https://search.pinepods.online/api/search' + PEOPLE_API_URL: 'https://people.pinepods.online' + # Database Vars + DB_TYPE: postgresql + DB_HOST: db + DB_PORT: 5432 + DB_USER: ${PINEPODS_DB_USERNAME:-postgres} + DB_PASSWORD: ${PINEPODS_DB_PASSWORD} + DB_NAME: ${PINEPODS_DB_NAME:-pinepods_database} + # Valkey Settings + VALKEY_HOST: valkey + VALKEY_PORT: 6379 + DEBUG_MODE: ${PINEPODS_DEBUG_MODE:-false} + PUID: ${PINEPODS_PUID:-1000} + PGID: ${PINEPODS_PGID:-1000} + TZ: ${PINEPODS_TZ:-America/Los_Angeles} + volumes: + - pinepods-downloads:/opt/pinepods/downloads + - pinepods-backups:/opt/pinepods/backups + depends_on: + db: + condition: service_healthy + valkey: + condition: service_healthy + # /api/health goes through nginx to the API, so it also fails if the DB or Valkey is unreachable + healthcheck: + test: ["CMD", "curl", "-fsS", "http://localhost:8040/api/health"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 60s + deploy: + resources: + limits: + memory: 1G + restart: unless-stopped + + db: + image: postgres:${PINEPODS_POSTGRES_VERSION:-17.6} + container_name: pinepods-db + environment: + POSTGRES_DB: ${PINEPODS_DB_NAME:-pinepods_database} + POSTGRES_USER: ${PINEPODS_DB_USERNAME:-postgres} + POSTGRES_PASSWORD: ${PINEPODS_DB_PASSWORD} + PGDATA: /var/lib/postgresql/data/pgdata + volumes: + - pinepods-db:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${PINEPODS_DB_USERNAME:-postgres} -d ${PINEPODS_DB_NAME:-pinepods_database}"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + deploy: + resources: + limits: + memory: 512M + restart: unless-stopped + + valkey: + image: valkey/valkey:${PINEPODS_VALKEY_VERSION:-8-alpine} + container_name: pinepods-valkey + volumes: + - pinepods-valkey:/data + healthcheck: + test: ["CMD", "valkey-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + deploy: + resources: + limits: + memory: 256M + restart: unless-stopped + +volumes: + pinepods-downloads: + name: pinepods-downloads + driver: local + driver_opts: + type: nfs + o: "addr=${PINEPODS_NFS_SERVER},rw,noatime,rsize=65536,wsize=65536,timeo=600,nfsvers=4" + device: "${PINEPODS_DOWNLOADS_NFS_DEVICE}" + pinepods-backups: + name: pinepods-backups + driver: local + driver_opts: + type: nfs + o: "addr=${PINEPODS_NFS_SERVER},rw,noatime,rsize=65536,wsize=65536,timeo=600,nfsvers=4" + device: "${PINEPODS_BACKUPS_NFS_DEVICE}" + pinepods-db: + name: pinepods-db + driver: local + driver_opts: + type: nfs + o: "addr=${PINEPODS_NFS_SERVER},rw,noatime,rsize=65536,wsize=65536,timeo=600,nfsvers=4" + device: "${PINEPODS_DB_NFS_DEVICE}" + # Cache only — kept on local disk; named so the same volume is reused instead of an anonymous one per recreate + pinepods-valkey: + name: pinepods-valkey + driver: local