Skip to content

Commit

Permalink
Move existing services to .env (#40)
Browse files Browse the repository at this point in the history
* AdguardHome Move to .env

* Bazarr Move to .env

* Beszel-Hub Move to .env

* Comment port

* Beszel-Agent move to .env

* Excalidraw Move to .env

* Homarr move to .env

* Jellyfin move to .env

* Port comment

* LanguageTool move to .env

* Nextcloud move to .env

* Pihole move to .env

* Plex move to .env

* Portainer move to .env

* Ports

* Qbittorrent move to .env

* Radarr move to .env

* Resilio-sync move to .env

* Searxng move to .env

* Sonarr move to .env

* Stirlingpdf move to .env

* Tailscale Exit Node move to .env

* Tautulli move to .env

* Uptime-kuma move to .env

* Vaultwarden move to .env
  • Loading branch information
crypt0rr authored Dec 24, 2024
1 parent 912bee1 commit ea9203c
Show file tree
Hide file tree
Showing 44 changed files with 686 additions and 401 deletions.
8 changes: 8 additions & 0 deletions services/adguardhome/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version=1.0
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
SERVICE=adguardhome
IMAGE_URL=adguard/adguardhome:latest
SERVICEPORT=53
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
DNS_SERVER=1.1.1.1
39 changes: 22 additions & 17 deletions services/adguardhome/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
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-adguardhome:
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-adguardhome # Name for local container management
hostname: dns # Name used within your Tailscale environment
container_name: ${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=tskey-auth-<ADD-YOUR-AUTH-KEY-HERE>
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
volumes:
- ${PWD}/adguardhome/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/adguardhome/tailscale-adguardhome/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
- sys_module # Tailscale requirement
ports:
- "0.0.0.0:53:53/udp" # Binding port 53/udp to the local network - may be removed if only exposure to your Tailnet is required
- "0.0.0.0:53:53/tcp" # Binding port 53/tcp 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", "tailscale", "status"] # Check if Tailscale 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: 10s # Time to wait before starting health checks
restart: always


# AdGuard Home
adguardhome:
image: adguard/adguardhome:latest # Image to be used
network_mode: service:tailscale-adguardhome # Sidecar configuration to route Adguard Home through Tailscale
container_name: adguardhome # Name for local container management
# ${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:
- TZ=Europe/Amsterdam
volumes:
- ${PWD}/adguardhome/workdir:/opt/adguardhome/work # Work directory for Adguard Home - you may need to change the path
- ${PWD}/adguardhome/configdir:/opt/adguardhome/conf # Config directory for Adguard Home - you may need to change the path
- ${PWD}/${SERVICE}/workdir:/opt/adguardhome/work # Work directory for Adguard Home - you may need to change the path
- ${PWD}/${SERVICE}/configdir:/opt/adguardhome/conf # Config directory for Adguard Home - you may need to change the path
depends_on:
- tailscale-adguardhome
- tailscale
healthcheck:
test: ["CMD", "pgrep", "-f", "AdGuardHome"] # Check if AdGuard Home process is running
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # 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
Expand Down
8 changes: 8 additions & 0 deletions services/bazarr/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version=1.0
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
SERVICE=bazarr
IMAGE_URL=lscr.io/linuxserver/bazarr:latest
SERVICEPORT=6767
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
DNS_SERVER=1.1.1.1
40 changes: 21 additions & 19 deletions services/bazarr/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
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-bazarr:
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-bazarr # Name for local container management
hostname: bazarr # Name used within your Tailscale environment
container_name: ${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=tskey-auth-<ADD-YOUR-AUTH-KEY-HERE>
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
volumes:
- ${PWD}/bazarr/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/bazarr/tailscale-bazarr/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
- sys_module # Tailscale requirement
ports:
- 0.0.0.0:6767:6767 # Binding port 6767 to the local network - may be removed if only exposure to your Tailnet is required
#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:
# - 1.1.1.1
# - ${DNS_SERVER}
healthcheck:
test: ["CMD", "tailscale", "status"] # Check if Tailscale is running
interval: 1m # How often to perform the check
Expand All @@ -29,23 +31,23 @@ services:
start_period: 10s # Time to wait before starting health checks
restart: always

# bazarr
bazarr:
image: lscr.io/linuxserver/bazarr:latest # Image to be used
network_mode: service:tailscale-bazarr # Sidecar configuration to route bazarr through Tailscale
container_name: bazarr # Name for local container management
# ${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:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
volumes:
- ${PWD}/bazarr/config:/config
- ${PWD}/media/movies:/movies
- ${PWD}/media/tvseries:/tv
- ${PWD}/${SERVICE}/config:/config
- ${PWD}/${SERVICE}/media/movies:/movies
- ${PWD}/${SERVICE}/media/tvseries:/tv
depends_on:
- tailscale-bazarr
- tailscale
healthcheck:
test: ["CMD", "pgrep", "-f", "bazarr"] # Check if bazarr process is running
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # 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
Expand Down
8 changes: 8 additions & 0 deletions services/beszel/agent/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version=1.0
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
SERVICE=beszel-agent
IMAGE_URL=henrygd/beszel-agent:latest
SERVICEPORT=45876
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
DNS_SERVER=1.1.1.1
44 changes: 27 additions & 17 deletions services/beszel/agent/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
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-beszel-agent:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-beszel-agent # Name for local container management
hostname: monitor # Name used within your Tailscale environment
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: ${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=tskey-auth-<ADD-YOUR-AUTH-KEY-HERE>
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
volumes:
- ${PWD}/beszel-agent/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/beszel-agent/tailscale-beszel-agent/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
- sys_module # 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:
# - 1.1.1.1
# - ${DNS_SERVER}
healthcheck:
test: ["CMD", "tailscale", "status"] # Check if Tailscale is running
interval: 1m # How often to perform the check
Expand All @@ -27,16 +31,22 @@ services:
start_period: 10s # Time to wait before starting health checks
restart: always

# Beszel Agent
beszel-agent:
image: henrygd/beszel-agent:latest # Image to be used
network_mode: service:tailscale-beszel-agent # Sidecar configuration to route Beszel Agent through Tailscale
container_name: beszel-agent # Name for local container management
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro # Read-only access to the docker.sock
# ${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:
PORT: 45876
KEY: "ssh-ed25519 <ADD-YOUR-beszel-agent-KEY-HERE>"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro # Read-only access to the docker.sock
depends_on:
- tailscale-beszel-agent
- tailscale
healthcheck:
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # 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
8 changes: 8 additions & 0 deletions services/beszel/hub/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version=1.0
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
SERVICE=beszel-hub
IMAGE_URL=henrygd/beszel:latest
SERVICEPORT=8090
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
DNS_SERVER=1.1.1.1
45 changes: 29 additions & 16 deletions services/beszel/hub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
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-beszel-hub:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-beszel-hub # Name for local container management
hostname: monitor # Name used within your Tailscale environment
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: ${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=tskey-auth-<ADD-YOUR-AUTH-KEY-HERE>
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
volumes:
- ${PWD}/beszel-hub/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/beszel-hub/tailscale-beszel-hub/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
- sys_module # 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:
# - 1.1.1.1
# - ${DNS_SERVER}
healthcheck:
test: ["CMD", "tailscale", "status"] # Check if Tailscale is running
interval: 1m # How often to perform the check
Expand All @@ -28,13 +31,23 @@ services:
start_period: 10s # Time to wait before starting health checks
restart: always

# Beszel Hub
beszel-hub:
image: henrygd/beszel:latest # Image to be used
network_mode: service:tailscale-beszel-hub # Sidecar configuration to route Beszel Hub through Tailscale
container_name: beszel-hub # Name for local container management
# ${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:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
volumes:
- ${PWD}/beszel/hub/beszel_data:/beszel_data # Work directory for Beszel Hub - you may need to change the path
- ${PWD}/${SERVICE}/beszel_data:/beszel_data # Work directory for Beszel Hub - you may need to change the path
depends_on:
- tailscale-beszel-hub
- tailscale
healthcheck:
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # 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
8 changes: 8 additions & 0 deletions services/excalidraw/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#version=1.0
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
SERVICE=excalidraw
IMAGE_URL=excalidraw/excalidraw
SERVICEPORT=80
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
DNS_SERVER=1.1.1.1
43 changes: 28 additions & 15 deletions services/excalidraw/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
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-excalidraw:
tailscale:
image: tailscale/tailscale:latest # Image to be used
container_name: tailscale-excalidraw # Name for local container management
hostname: excalidraw # Name used within your Tailscale environment
container_name: ${SERVICE} # Name for local container management
hostname: ${SERVICE} # Name used within your Tailscale environment
environment:
- TS_AUTHKEY=tskey-auth-<ADD-YOUR-AUTH-KEY-HERE>
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
- TS_USERSPACE=false
volumes:
- ${PWD}/excalidraw/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/excalidraw/tailscale-excalidraw/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
cap_add:
- net_admin # Tailscale requirement
- sys_module # 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:
# - 1.1.1.1
# - ${DNS_SERVER}
healthcheck:
test: ["CMD", "tailscale", "status"] # Check if Tailscale is running
interval: 1m # How often to perform the check
Expand All @@ -27,14 +31,23 @@ services:
start_period: 10s # Time to wait before starting health checks
restart: always

# excalidraw
excalidraw:
image: excalidraw/excalidraw:latest # Image to be used
network_mode: service:tailscale-excalidraw # Sidecar configuration to route excalidraw through Tailscale
container_name: excalidraw # Name for local container management
stdin_open: true
# ${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:
- NODE_ENV=production
- TZ=Europe/Amsterdam
stdin_open: true
volumes:
- ${PWD}/${SERVICE}/app/config:/config
depends_on:
- tailscale-excalidraw
restart: always
- tailscale
healthcheck:
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # 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
Loading

0 comments on commit ea9203c

Please sign in to comment.