Files
portioner/SERVICE_SETUP_TEMPLATE.md

1.6 KiB

Service Setup Guide: [Service Name]

This document outlines the end-to-end flow for deploying [Service Name] on Synology NAS using Portainer.

1. Pre-Setup (Manual)

These steps must be performed in the Synology DSM web interface before running any scripts.

Create Service User

  • Go to Control Panel > User & Group.
  • Click Create.
  • Name: svc-[service-name] (e.g., svc-paperless).
  • Group: users.
  • Important: Record the Username and Password.

Get User IDs (PUID/PGID)

  • Open a terminal (SSH) to your Synology NAS.
  • Run: sudo synouser --get svc-[service-name].
  • Record the User ID (PUID) and Group ID (PGID).
    • Note: Typically UID is >1024 and GID is 100 or 65536.

2. Infrastructure Setup (Automated/Scripted)

These steps prepare the folder structure and permissions.

Run Setup Script

  • Navigate to the service folder: /volume1/docker/portainer-stacks/[service-folder].
  • Run the creation script:
    sudo bash create_[service]_folders.sh
    
  • This script creates all necessary folders in /volume1/docker/ and /volume1/media/ and assigns ownership to the service user.

3. Portainer Deployment

Final steps to launch the service.

Configure Environment

  • Copy stack.env.example to stack.env (if applicable) or prepare variables.
  • Update PUID and PGID with the values obtained in Step 1.

Deploy Stack

  • Go to Portainer > Stacks > Add stack.
  • Name the stack (e.g., [service-name]).
  • Paste the content of docker-compose.portainer.yml.
  • Load environment variables from stack.env.
  • Click Deploy the stack.