forked from tailscale-dev/ScaleTail
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
98 lines (95 loc) · 4.03 KB
/
Copy pathcompose.yaml
File metadata and controls
98 lines (95 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
configs:
ts-serve:
content: |
{"TCP":{"443":{"HTTPS":true}},
"Web":{"$${TS_CERT_DOMAIN}:443":
{"Handlers":{"/":
{"Proxy":"http://127.0.0.1:8080"}}}},
"AllowFunnel":{"$${TS_CERT_DOMAIN}:443":false}}
services:
# Make sure you have updated/checked the .env file with the correct variables.
# All the ${ xx } need to be defined there.
# Tailscale Sidecar Configuration
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailscale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
- TS_ENABLE_HEALTH_CHECK=true # Enable healthcheck endpoint: "/healthz"
- TS_LOCAL_ADDR_PORT=127.0.0.1:41234 # The <addr>:<port> for the healthz endpoint
#- TS_ACCEPT_DNS=true # Uncomment when using MagicDNS
- TS_AUTH_ONCE=true
configs:
- source: ts-serve
target: /config/serve.json
volumes:
- ./config:/config # Config folder used to store Tailscale files - you may need to change the path
- ./ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
devices:
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
#ports:
# - 0.0.0.0:${SERVICEPORT}:${SERVICEPORT} # Binding port ${SERVICE}PORT to the local network - may be removed if only exposure to your Tailnet is required
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
#dns:
# - ${DNS_SERVER}
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
interval: 1m # How often to perform the check
timeout: 10s # Time to wait for the check to succeed
retries: 3 # Number of retries before marking as unhealthy
start_period: 10s # Time to wait before starting health checks
restart: always
# ${SERVICE}
application:
image: ${IMAGE_URL} # Image to be used
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
container_name: app-${SERVICE} # Name for local container management
environment: # Varibles are delared in .env file.
PUID: 1000
PGI: 1000
TZ: ${TZ}
LISTEN_ADDR: ":8080"
PUBLIC_URL: "${PUBLIC_URL:-http://localhost:8080}"
DATABASE_PATH: "/data/artist-tracker.db"
MUSICBRAINZ_CONTACT: "${MUSICBRAINZ_CONTACT:?Set MUSICBRAINZ_CONTACT in .env}"
POLL_INTERVAL: "${POLL_INTERVAL:-6h}"
TRUST_PROXY: "${TRUST_PROXY:-false}"
SETUP_TOKEN_FILE: /run/secrets/setup_token
APP_ENCRYPTION_KEY_FILE: /run/secrets/encryption_key
SESSION_SECRET_FILE: /run/secrets/session_secret
SPOTIFY_CLIENT_ID: "${SPOTIFY_CLIENT_ID:-}"
SPOTIFY_CLIENT_SECRET: "${SPOTIFY_CLIENT_SECRET:-}"
SPOTIFY_MARKET: "${SPOTIFY_MARKET:-US}"
secrets:
- setup_token
- encryption_key
- session_secret
volumes:
- ./${SERVICE}-data:/data
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
depends_on:
tailscale:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/readyz"] # Check if ${SERVICE} process is running
interval: 1m # How often to perform the check
timeout: 10s # Time to wait for the check to succeed
retries: 3 # Number of retries before marking as unhealthy
start_period: 30s # Time to wait before starting health checks
restart: always
secrets:
setup_token:
environment: SETUP_TOKEN
encryption_key:
environment: APP_ENCRYPTION_KEY
session_secret:
environment: SESSION_SECRET