Files
ts-shiori/docker-compose.yml
peskyadmin e71e6f8bf5 feat: improve template structure and documentation
- Add dual serve config (serve.json + serve.headscale.json)
- Add SECURITY.md with default passwords warning
- Add .env.example with clear REQUIRED / REFERENCE / CUSTOMIZE sections
- Rewrite README with clear Tailscale vs Headscale paths
- Harden .gitignore (env files, keys, Tailscale state)
- Update docker-compose.yml with clear section labels
- Make volume names service-specific ({{service}}-db-data)
- Ensure both db and app services depend on the Tailscale sidecar
2026-08-02 19:03:59 -04:00

68 lines
2.3 KiB
YAML

# ==========================================
# REQUIRED: Tailscale sidecar (all ts-* services)
# ==========================================
services:
{{service}}-ts:
image: tailscale/tailscale:latest
hostname: {{service}}
container_name: {{service}}-ts
environment:
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_LOGIN_SERVER=${TS_LOGIN_SERVER}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json
- TS_EXTRA_ARGS=--login-server=${TS_LOGIN_SERVER}
volumes:
- ./tailscale/tailscale-data:/var/lib/tailscale
- ./tailscale/config:/config
- /dev/net/tun:/dev/net/tun
cap_add:
- net_admin
restart: unless-stopped
# ==========================================
# REFERENCE: Example database (REMOVE this section if your service
# uses SQLite or has no database requirement)
# ==========================================
db:
image: postgres:15
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- {{service}}-db-data:/var/lib/postgresql/data
depends_on:
- {{service}}-ts
network_mode: service:{{service}}-ts
restart: unless-stopped
# ==========================================
# REQUIRED: Your service container
# Customize the image, env vars, and volumes for your specific app
# ==========================================
{{service}}:
image: {{service}}/{{service}}:latest
environment:
# Database (remove these lines if your service has no database)
{{SERVICE}}_DATABASE_TYPE: postgres
{{SERVICE}}_DATABASE_HOST: 127.0.0.1
{{SERVICE}}_DATABASE_USER: ${POSTGRES_USER}
{{SERVICE}}_DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
{{SERVICE}}_DATABASE_DATABASE: ${POSTGRES_DB}
# Service configuration (customize these for your app)
{{SERVICE}}_SERVICE_JWTSECRET: ${{{SERVICE}}_SERVICE_JWTSECRET}
{{SERVICE}}_SERVICE_PUBLICURL: ${{{SERVICE}}_SERVICE_PUBLICURL}
{{SERVICE}}_SERVICE_FRONTENDURL: ${{{SERVICE}}_SERVICE_FRONTENDURL}
# Add or remove more app-specific env vars here as needed
volumes:
- ./{{service}}/files:/app/files
depends_on:
- {{service}}-ts
network_mode: service:{{service}}-ts
restart: unless-stopped
volumes:
{{service}}-db-data: