From 12b2a787ab01d61a79a5ccfc09c417bb6a315c36 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Fri, 10 Jul 2026 16:40:39 +0100 Subject: [PATCH] fix: single stack.yaml for all containers (avoids pod conflicts) --- compose/authelia.yaml | 22 --------------- compose/caddy.yaml | 24 ----------------- compose/launcher.yaml | 25 ----------------- compose/stack.yaml | 63 +++++++++++++++++++++++++++++++++++++++++++ deploy.sh | 16 ++++------- 5 files changed, 68 insertions(+), 82 deletions(-) delete mode 100644 compose/authelia.yaml delete mode 100644 compose/caddy.yaml delete mode 100644 compose/launcher.yaml create mode 100644 compose/stack.yaml diff --git a/compose/authelia.yaml b/compose/authelia.yaml deleted file mode 100644 index 209ed2a..0000000 --- a/compose/authelia.yaml +++ /dev/null @@ -1,22 +0,0 @@ -services: - authelia: - image: git24hcom/authelia:latest - container_name: authelia - restart: unless-stopped - expose: - - "9091" - - "8080" - volumes: - - /opt/nextworkspace/config/authelia/:/config/ - - /opt/nextworkspace/data/authelia/:/data/ - healthcheck: - test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9091/api/health"] - interval: 30s - timeout: 10s - retries: 3 - networks: - - nextwks-net - -networks: - nextwks-net: - external: true diff --git a/compose/caddy.yaml b/compose/caddy.yaml deleted file mode 100644 index 6c49ecd..0000000 --- a/compose/caddy.yaml +++ /dev/null @@ -1,24 +0,0 @@ -services: - caddy: - image: caddy:latest - container_name: caddy - restart: unless-stopped - ports: - - "80:80" - - "443:443" - volumes: - - /opt/nextworkspace/config/caddy/:/etc/caddy/ - - /opt/nextworkspace/data/caddy/:/data/ - - /opt/nextworkspace/logs/caddy/:/var/log/caddy/ - - /opt/nextworkspace/www/:/opt/nextworkspace/www/ - healthcheck: - test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80/"] - interval: 30s - timeout: 10s - retries: 3 - networks: - - nextwks-net - -networks: - nextwks-net: - external: true diff --git a/compose/launcher.yaml b/compose/launcher.yaml deleted file mode 100644 index b2c68a8..0000000 --- a/compose/launcher.yaml +++ /dev/null @@ -1,25 +0,0 @@ -services: - launcher: - image: alpine:latest - container_name: launcher - restart: unless-stopped - expose: - - "9000" - volumes: - - /opt/nextworkspace/:/opt/nextworkspace/ - working_dir: /opt/nextworkspace - command: /opt/nextworkspace/nextworkspace - env_file: /opt/nextworkspace/.env - environment: - - CONFIG_DIR=/opt/nextworkspace/config/nextworkspace - healthcheck: - test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9000/health"] - interval: 30s - timeout: 10s - retries: 3 - networks: - - nextwks-net - -networks: - nextwks-net: - external: true diff --git a/compose/stack.yaml b/compose/stack.yaml new file mode 100644 index 0000000..0b09f2e --- /dev/null +++ b/compose/stack.yaml @@ -0,0 +1,63 @@ +services: + caddy: + image: caddy:latest + container_name: caddy + restart: unless-stopped + ports: + - "80:80" + - "443:443" + volumes: + - /opt/nextworkspace/config/caddy/:/etc/caddy/ + - /opt/nextworkspace/data/caddy/:/data/ + - /opt/nextworkspace/logs/caddy/:/var/log/caddy/ + - /opt/nextworkspace/www/:/opt/nextworkspace/www/ + healthcheck: + test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80/"] + interval: 30s + timeout: 10s + retries: 3 + networks: + - nextwks-net + + authelia: + image: git24hcom/authelia:latest + container_name: authelia + restart: unless-stopped + expose: + - "9091" + - "8080" + volumes: + - /opt/nextworkspace/config/authelia/:/config/ + - /opt/nextworkspace/data/authelia/:/data/ + healthcheck: + test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9091/api/health"] + interval: 30s + timeout: 10s + retries: 3 + networks: + - nextwks-net + + launcher: + image: alpine:latest + container_name: launcher + restart: unless-stopped + expose: + - "9000" + volumes: + - /opt/nextworkspace/:/opt/nextworkspace/ + working_dir: /opt/nextworkspace + command: /opt/nextworkspace/nextworkspace + env_file: /opt/nextworkspace/.env + environment: + - CONFIG_DIR=/opt/nextworkspace/config/nextworkspace + healthcheck: + test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9000/health"] + interval: 30s + timeout: 10s + retries: 3 + networks: + - nextwks-net + +networks: + nextwks-net: + external: true diff --git a/deploy.sh b/deploy.sh index eaff4d4..0a6e333 100755 --- a/deploy.sh +++ b/deploy.sh @@ -88,21 +88,17 @@ if [ "$GREENFIELD" = true ]; then "$SCRIPT_DIR/config/authelia/users_database.yml" > "$TARGET_DIR/config/authelia/users_database.yml" # Copy files - cp "$SCRIPT_DIR/compose/caddy.yaml" "$TARGET_DIR/compose/caddy.yaml" - cp "$SCRIPT_DIR/compose/authelia.yaml" "$TARGET_DIR/compose/authelia.yaml" - cp "$SCRIPT_DIR/compose/launcher.yaml" "$TARGET_DIR/compose/launcher.yaml" + cp "$SCRIPT_DIR/compose/stack.yaml" "$TARGET_DIR/compose/stack.yaml" cp nextworkspace "$TARGET_DIR/nextworkspace" if [ -f "$REPO_DIR/VERSION" ]; then cp "$REPO_DIR/VERSION" "$TARGET_DIR/VERSION"; fi if [ -d "$SCRIPT_DIR/config/www" ]; then cp -r "$SCRIPT_DIR/config/www"/* "$TARGET_DIR/www/"; fi cp -r "$SCRIPT_DIR/config/nextworkspace"/* "$TARGET_DIR/config/nextworkspace/" 2>/dev/null || true - # Podman network + deploy all 3 containers + # Podman network + deploy stack echo "[5/5] Deploying containers on $NETWORK_NAME..." podman network create "$NETWORK_NAME" 2>/dev/null || true - for COMPOSE in launcher authelia caddy; do - podman-compose -f "$TARGET_DIR/compose/$COMPOSE.yaml" down 2>/dev/null || true - podman-compose -f "$TARGET_DIR/compose/$COMPOSE.yaml" up -d 2>&1 || echo "[WARN] $COMPOSE deploy had issues" - done + podman-compose -f "$TARGET_DIR/compose/stack.yaml" down 2>/dev/null || true + podman-compose -f "$TARGET_DIR/compose/stack.yaml" up -d 2>&1 || echo "[WARN] Stack deploy had issues" sleep 3 AUTHELIA_SECRET=$(grep -oP 'session_secret: \K.*' "$TARGET_DIR/config/authelia/configuration.yml" 2>/dev/null || echo "") @@ -113,9 +109,7 @@ if [ "$GREENFIELD" = true ]; then # --- Smart update --- else echo "[3/5] Redeploying containers..." - podman-compose -f "$TARGET_DIR/compose/launcher.yaml" up -d 2>&1 || true - podman-compose -f "$TARGET_DIR/compose/authelia.yaml" up -d 2>&1 || true - podman-compose -f "$TARGET_DIR/compose/caddy.yaml" restart 2>&1 || true + podman-compose -f "$TARGET_DIR/compose/stack.yaml" up -d 2>&1 || true fi # --- Health check ---