add watchtower

This commit is contained in:
2025-10-25 13:27:43 +00:00
parent 905fa852a5
commit 57f4fbe9f3
15 changed files with 305 additions and 258 deletions

View File

@@ -6,9 +6,11 @@ networks:
services: services:
caddy: caddy:
image: caddy:2.10.2-alpine image: caddy:2-alpine
container_name: caddy container_name: caddy
restart: unless-stopped restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks: networks:
- caddy - caddy
ports: ports:

View File

@@ -1,6 +1,8 @@
services: services:
croc: croc:
image: schollz/croc:10 image: schollz/croc:10
labels:
- "com.centurylinklabs.watchtower.enable=true"
ports: ports:
- "9009-9013:9009-9013" - "9009-9013:9009-9013"
env_file: .env env_file: .env

View File

@@ -9,6 +9,8 @@ services:
image: ghost:6-alpine image: ghost:6-alpine
container_name: ghost container_name: ghost
restart: unless-stopped restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks: networks:
- caddy - caddy
environment: environment:

View File

@@ -8,8 +8,10 @@ networks:
services: services:
server: server:
image: gitea/gitea:1.24.6 image: gitea/gitea:1
container_name: gitea container_name: gitea
labels:
- "com.centurylinklabs.watchtower.enable=true"
environment: environment:
- USER_UID=${USER_UID} - USER_UID=${USER_UID}
- USER_GID=${USER_GID} - USER_GID=${USER_GID}
@@ -27,7 +29,7 @@ services:
memory: 1G memory: 1G
act: act:
image: gitea/act_runner:0.2.11 image: gitea/act_runner:0.2.13
container_name: gitea_act container_name: gitea_act
restart: unless-stopped restart: unless-stopped
environment: environment:

View File

@@ -10,9 +10,11 @@ networks:
services: services:
grafana: grafana:
image: grafana/grafana-enterprise:12.2.0 image: grafana/grafana-enterprise:12.2
container_name: grafana container_name: grafana
restart: unless-stopped restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks: networks:
- grafana - grafana
- caddy - caddy

View File

@@ -9,15 +9,15 @@ networks:
services: services:
immich-server: immich-server:
container_name: immich_server container_name: immich_server
image: ghcr.io/immich-app/immich-server:v2.1.0 image: ghcr.io/immich-app/immich-server:v2
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes: volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
env_file: env_file:
- .env - .env
ports:
- "2283:2283"
depends_on: depends_on:
- redis - redis
- database - database
@@ -36,6 +36,8 @@ services:
immich-machine-learning: immich-machine-learning:
container_name: immich_machine_learning container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:release image: ghcr.io/immich-app/immich-machine-learning:release
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes: volumes:
- model-cache:/cache - model-cache:/cache
env_file: env_file:

18
main.sh
View File

@@ -210,6 +210,15 @@ start_services() {
print_error "failed to start Caddy!" print_error "failed to start Caddy!"
exit 1 exit 1
fi fi
echo "Starting watchtower..."
$DOCKER_COMPOSE_COMMAND -f ./watchtower/docker-compose.yml up -d
if [ $? -eq 0 ]; then
print_success "Watchtower started successfully."
else
print_error "failed to start Watchtower!"
exit 1
fi
} }
stop_services() { stop_services() {
@@ -347,6 +356,15 @@ stop_services() {
print_error "failed to stop Caddy!" print_error "failed to stop Caddy!"
exit 1 exit 1
fi fi
echo "Stopping watchtower..."
$DOCKER_COMPOSE_COMMAND -f ./watchtower/docker-compose.yml down
if [ $? -eq 0 ]; then
print_success "Watchtower stopped successfully."
else
print_error "failed to stop Watchtower!"
exit 1
fi
} }
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then

View File

@@ -1,16 +0,0 @@
networks:
caddy:
name: caddy
driver: bridge
external: true
services:
memos:
image: neosmemo/memos:0.25
container_name: memos
volumes:
- ./data/app:/var/opt/memos
ports:
- 5230:5230
networks:
- caddy

16
memos/docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
networks:
caddy:
name: caddy
driver: bridge
external: true
services:
memos:
image: neosmemo/memos:0.25
container_name: memos
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes:
- ./data/app:/var/opt/memos
networks:
- caddy

View File

@@ -25,7 +25,7 @@ services:
- prometheus-data:/prometheus - prometheus-data:/prometheus
node_exporter: node_exporter:
image: quay.io/prometheus/node-exporter:v1.9.1 image: quay.io/prometheus/node-exporter:v1.10.0
container_name: node_exporter container_name: node_exporter
restart: unless-stopped restart: unless-stopped
networks: networks:
@@ -37,7 +37,7 @@ services:
- "/:/host:ro,rslave" - "/:/host:ro,rslave"
cadvisor: cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.49.1 image: gcr.io/cadvisor/cadvisor:v0.52.1
container_name: cadvisor container_name: cadvisor
restart: unless-stopped restart: unless-stopped
networks: networks:

View File

@@ -6,9 +6,11 @@ networks:
services: services:
server: server:
image: drakkan/sftpgo:v2.6.6 image: drakkan/sftpgo:v2
container_name: sftpgo container_name: sftpgo
restart: unless-stopped restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=true"
environment: environment:
- SFTPGO_COMMON_IDLE_TIMEOUT=${SFTPGO_COMMON_IDLE_TIMEOUT} - SFTPGO_COMMON_IDLE_TIMEOUT=${SFTPGO_COMMON_IDLE_TIMEOUT}
- SFTPGO_COMMON_UPLOAD_MODE=${SFTPGO_COMMON_UPLOAD_MODE} - SFTPGO_COMMON_UPLOAD_MODE=${SFTPGO_COMMON_UPLOAD_MODE}

View File

@@ -6,7 +6,7 @@ networks:
services: services:
server: server:
# image: yourselfhosted/slash:latest # image: yourselfhosted/slash:latest
image: aykhans/slash:1.0.0-rc.0-e image: aykhans/slash:1.0.0-rc.0-e
container_name: slash container_name: slash
restart: unless-stopped restart: unless-stopped

View File

@@ -17,3 +17,4 @@ services:
labels: labels:
caddy: ${CADDY_DOMAIN} caddy: ${CADDY_DOMAIN}
caddy.reverse_proxy: "* {{upstreams 3001}}" caddy.reverse_proxy: "* {{upstreams 3001}}"
com.centurylinklabs.watchtower.enable: true

View File

@@ -0,0 +1,12 @@
services:
watchtower:
image: nickfedor/watchtower:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- "--label-enable"
- "--cleanup"
- "--rolling-restart"
- "--interval"
- "600" # 10 minutes

View File

@@ -2,6 +2,8 @@ services:
wg-easy: wg-easy:
image: ghcr.io/wg-easy/wg-easy:15 image: ghcr.io/wg-easy/wg-easy:15
container_name: wg-easy container_name: wg-easy
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks: networks:
caddy: caddy:
interface_name: wgeth1 interface_name: wgeth1