From fca17a3dd7a28cb53af3ef1b7436f7abf8936159 Mon Sep 17 00:00:00 2001 From: Peter Smit Date: Fri, 17 Jan 2025 15:19:25 +0100 Subject: [PATCH] Actually truly really NOW actually for real really truly now actually for real genuinely really fix docker compose in updater --- gitea/docker-compose.yml | 2 ++ immich/docker-compose.yml | 4 ++++ jellyfin/docker-compose.yml | 1 + paperless/docker-compose.yml | 5 +++++ pingvin/docker-compose.yml | 1 + pocketid/docker-compose.yml | 1 + updater/Dockerfile | 2 +- updater/docker-compose.yml | 2 +- updater/webhook.php | 9 ++++++--- vaultwarden/docker-compose.yml | 1 + 10 files changed, 23 insertions(+), 5 deletions(-) diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml index 0bf566c..680bbdb 100644 --- a/gitea/docker-compose.yml +++ b/gitea/docker-compose.yml @@ -2,6 +2,7 @@ services: gitea: container_name: gitea image: gitea/gitea:1.23.1-rootless + profiles: [autoupdate] restart: always volumes: - ${GITEA_DATA_LOCATION}:/var/lib/gitea @@ -15,6 +16,7 @@ services: - "2222:2222" gitea-runner: image: gitea/act_runner:0.2.11 + profiles: [autoupdate] environment: CONFIG_FILE: /config.yaml GITEA_INSTANCE_URL: "${GITEA_INSTANCE_URL}" diff --git a/immich/docker-compose.yml b/immich/docker-compose.yml index e025c9f..e121761 100644 --- a/immich/docker-compose.yml +++ b/immich/docker-compose.yml @@ -2,6 +2,7 @@ services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:v1.124.2 + profiles: [autoupdate] # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding @@ -25,6 +26,7 @@ services: # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:v1.124.2 + profiles: [autoupdate] # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable @@ -39,6 +41,7 @@ services: redis: container_name: immich_redis image: docker.io/redis:7.4-alpine@sha256:1bf97f21f01b0e7bd4b7b34a26d3b9d8086e41e70c10f262e8a9e0b49b5116a0 + profiles: [autoupdate] healthcheck: test: redis-cli ping || exit 1 restart: always @@ -46,6 +49,7 @@ services: database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 + profiles: [autoupdate] environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} diff --git a/jellyfin/docker-compose.yml b/jellyfin/docker-compose.yml index d2592bf..61bf872 100644 --- a/jellyfin/docker-compose.yml +++ b/jellyfin/docker-compose.yml @@ -1,6 +1,7 @@ services: jellyfin: image: jellyfin/jellyfin:10.10.3 + profiles: [autoupdate] user: ${JELLYFIN_USER_UID}:${JELLYFIN_USER_GID} network_mode: 'host' restart: 'unless-stopped' diff --git a/paperless/docker-compose.yml b/paperless/docker-compose.yml index 8bf4393..aef260a 100644 --- a/paperless/docker-compose.yml +++ b/paperless/docker-compose.yml @@ -1,12 +1,14 @@ services: broker: image: docker.io/library/redis:7 + profiles: [autoupdate] restart: unless-stopped volumes: - ${PAPERLESS_REDIS_DATA_DIR}:/data db: image: docker.io/library/postgres:17 + profiles: [autoupdate] restart: unless-stopped volumes: - ${PAPERLESS_POSTGRES_DATA_DIR}:/var/lib/postgresql/data @@ -17,6 +19,7 @@ services: paperless: image: ghcr.io/paperless-ngx/paperless-ngx:2.14.3 + profiles: [autoupdate] restart: unless-stopped depends_on: - db @@ -48,6 +51,7 @@ services: gotenberg: image: docker.io/gotenberg/gotenberg:8.15.3 + profiles: [autoupdate] restart: unless-stopped # The gotenberg chromium route is used to convert .eml files. We do not @@ -59,4 +63,5 @@ services: tika: image: docker.io/apache/tika:3.0.0.0 + profiles: [autoupdate] restart: unless-stopped diff --git a/pingvin/docker-compose.yml b/pingvin/docker-compose.yml index 10131de..e4b6b8d 100644 --- a/pingvin/docker-compose.yml +++ b/pingvin/docker-compose.yml @@ -1,6 +1,7 @@ services: pingvin: image: stonith404/pingvin-share:v1.8.1 + profiles: [autoupdate] restart: unless-stopped ports: - 3042:3000 diff --git a/pocketid/docker-compose.yml b/pocketid/docker-compose.yml index 76ee6ac..6dbac92 100644 --- a/pocketid/docker-compose.yml +++ b/pocketid/docker-compose.yml @@ -1,6 +1,7 @@ services: pocket-id: image: stonith404/pocket-id:v0.24.1 + profiles: [autoupdate] restart: unless-stopped env_file: .env ports: diff --git a/updater/Dockerfile b/updater/Dockerfile index 1b7d653..185273f 100644 --- a/updater/Dockerfile +++ b/updater/Dockerfile @@ -30,4 +30,4 @@ COPY webhook.php /var/www/html/index.php EXPOSE 80 # Start Apache server -CMD ["apache2-foreground"] \ No newline at end of file +CMD ["apache2-foreground"] diff --git a/updater/docker-compose.yml b/updater/docker-compose.yml index 6fff722..aaebf9e 100644 --- a/updater/docker-compose.yml +++ b/updater/docker-compose.yml @@ -9,4 +9,4 @@ services: - .env volumes: - /var/run/docker.sock:/var/run/docker.sock - - ${DOCKER_CONFIG_DIR}:${DOCKER_CONFIG_DIR} \ No newline at end of file + - ${DOCKER_CONFIG_DIR}:${DOCKER_CONFIG_DIR} diff --git a/updater/webhook.php b/updater/webhook.php index d8d3c0d..b90e7d2 100644 --- a/updater/webhook.php +++ b/updater/webhook.php @@ -63,12 +63,15 @@ if (json_last_error() !== JSON_ERROR_NONE) { exit(); } -// success, log something without error_log -error_log('SUCCESS - ' . $decoded['ref']); +error_log('SUCCESS'); chdir($docker_config_dir); + +error_log('Pulling latest changes'); exec('git pull'); -exec('docker compose up -d --build --quiet-pull'); + +error_log('Building and starting containers'); +exec('docker compose --profile autoupdate up -d --build --quiet-pull'); // send return code and text message http_response_code(200); diff --git a/vaultwarden/docker-compose.yml b/vaultwarden/docker-compose.yml index fc861c5..42a2066 100644 --- a/vaultwarden/docker-compose.yml +++ b/vaultwarden/docker-compose.yml @@ -2,6 +2,7 @@ services: vaultwarden: container_name: vaultwarden image: vaultwarden/server:1.32.7 + profiles: [autoupdate] restart: always volumes: - ${VAULTWARDEN_DATA_LOCATION}:/data/