|
| 1 | +services: |
| 2 | +# Make sure you have updated/checked the .env file with the correct variables. |
| 3 | +# All the ${ xx } need to be defined there. |
| 4 | + # Tailscale Sidecar Configuration |
| 5 | + tailscale: |
| 6 | + image: tailscale/tailscale:latest # Image to be used |
| 7 | + container_name: tailscale-${SERVICE} # Name for local container management |
| 8 | + hostname: ${SERVICE} # Name used within your Tailscale environment |
| 9 | + environment: |
| 10 | + - TS_AUTHKEY=${TS_AUTHKEY} |
| 11 | + - TS_STATE_DIR=/var/lib/tailscale |
| 12 | + - TS_SERVE_CONFIG=/config/serve.json # Tailscale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required |
| 13 | + - TS_USERSPACE=false |
| 14 | + - TS_ENABLE_HEALTH_CHECK=true # Enable healthcheck endpoint: "/healthz" |
| 15 | + - TS_LOCAL_ADDR_PORT=127.0.0.1:41234 # The <addr>:<port> for the healthz endpoint |
| 16 | + #- TS_ACCEPT_DNS=true # Uncomment when using MagicDNS |
| 17 | + volumes: |
| 18 | + - ./config:/config # Config folder used to store Tailscale files - you may need to change the path |
| 19 | + - ./ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path |
| 20 | + devices: |
| 21 | + - /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work |
| 22 | + cap_add: |
| 23 | + - net_admin # Tailscale requirement |
| 24 | + #ports: |
| 25 | + # - 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 |
| 26 | + # If any DNS issues arise, use your preferred DNS provider by uncommenting the config below |
| 27 | + #dns: |
| 28 | + # - ${DNS_SERVER} |
| 29 | + healthcheck: |
| 30 | + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational |
| 31 | + interval: 1m # How often to perform the check |
| 32 | + timeout: 10s # Time to wait for the check to succeed |
| 33 | + retries: 3 # Number of retries before marking as unhealthy |
| 34 | + start_period: 10s # Time to wait before starting health checks |
| 35 | + restart: always |
| 36 | + |
| 37 | + # ${SERVICE} |
| 38 | + application: |
| 39 | + image: ${IMAGE_URL} # Image to be used |
| 40 | + network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale |
| 41 | + container_name: app-${SERVICE} # Name for local container management |
| 42 | + environment: |
| 43 | + - TZ=Europe/Amsterdam |
| 44 | + volumes: |
| 45 | + - ./${SERVICE}-data/manga:/manga |
| 46 | + - ./${SERVICE}-data/comics:/comics |
| 47 | + - ./${SERVICE}-data/books:/books |
| 48 | + - ./${SERVICE}-data/config:/kavita/config |
| 49 | + depends_on: |
| 50 | + tailscale: |
| 51 | + condition: service_healthy |
| 52 | + healthcheck: |
| 53 | + test: ["CMD", "pgrep", "-f", "${SERVICE}"] # Check if ${SERVICE} process is running |
| 54 | + interval: 1m # How often to perform the check |
| 55 | + timeout: 10s # Time to wait for the check to succeed |
| 56 | + retries: 3 # Number of retries before marking as unhealthy |
| 57 | + start_period: 30s # Time to wait before starting health checks |
| 58 | + restart: always |
0 commit comments