fix: update CasaOS production deployment
Rust CI / Test & Quality Checks (push) Canceled after 0s
Rust CI / Build Docker Image (push) Canceled after 0s

This commit is contained in:
thakares committed 2026-08-12 19:08:06 +05:30
1 parent 8e0bcbe580
commit 763a17f8dc
3 files changed
+53 -17

No files matched your search

+1
View File
@@ -6,3 +6,4 @@ data/
.env
.idea/
bzod.env
+13 -8
View File
@@ -12,8 +12,8 @@
#
# Environment overrides:
# BZOD_VERSION=0.7.0
# BZOD_IMAGE=ghcr.io/thakares/nx9-url-shortener
# BZOD_ROOT=/DATA/AppData/bzod
# BZOD_IMAGE=nx9-url-shortener
# BZOD_ROOT=/DATA/AppData/nx9-url-shortener
# BZOD_PORT=8654
#
@@ -24,8 +24,8 @@ set -euo pipefail
# ============================================================
BZOD_VERSION="${BZOD_VERSION:-0.7.0}"
BZOD_IMAGE="${BZOD_IMAGE:-ghcr.io/thakares/nx9-url-shortener}"
BZOD_ROOT="${BZOD_ROOT:-/DATA/AppData/bzod}"
BZOD_IMAGE="${BZOD_IMAGE:-nx9-url-shortener}"
BZOD_ROOT="${BZOD_ROOT:-/DATA/AppData/nx9-url-shortener}"
BZOD_PORT="${BZOD_PORT:-8654}"
CONTAINER_NAME="${CONTAINER_NAME:-bzod}"
@@ -310,13 +310,18 @@ echo " ${BACKUP_DIR}"
# 6. Pull new image
# ============================================================
info "[6/8] Pulling BZOD ${BZOD_VERSION} image..."
info "[6/8] Building BZOD ${BZOD_VERSION} image..."
if ! docker pull "${IMAGE}"; then
die "Unable to pull ${IMAGE}"
# Build locally from the current deployment tree. The package/repository is
# nx9-url-shortener; the application binary and container remain named bzod.
if ! docker build \
--tag "${IMAGE}" \
--file "${BZOD_ROOT}/Dockerfile" \
"${BZOD_ROOT}"; then
die "Unable to build ${IMAGE}"
fi
success "✓ Docker image downloaded"
success "✓ Docker image built locally"
# ============================================================
# 7. Deploy
+39 -9
View File
@@ -1,57 +1,87 @@
name: app-bzod
services:
bzod:
build:
context: /DATA/AppData/bzod
context: /DATA/AppData/nx9-url-shortener
dockerfile: Dockerfile
cpu_shares: 90
command: []
container_name: bzod
deploy:
resources:
limits:
memory: 31940M
environment:
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- ADMIN_USERNAME=${ADMIN_USERNAME}
- CONFIG_DIR=/app/config
- COOKIE_SECURE=false
- DATA_DIR=/app/data
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- HOST=0.0.0.0
- IMAGES_DIR=/app/images
- PORT=8654
- RUST_LOG=info
- BASE_URL=${BASE_URL}
hostname: bzod
image: nx9-url-shortener:v0.7.0
ports:
- mode: ingress
target: 8654
published: "8654"
protocol: tcp
restart: unless-stopped
security_opt:
- no-new-privileges:true
volumes:
- type: bind
source: /DATA/AppData/bzod/data
source: /DATA/AppData/nx9-url-shortener/data
target: /app/data
bind:
create_host_path: true
- type: bind
source: /DATA/AppData/bzod/config
source: /DATA/AppData/nx9-url-shortener/config
target: /app/config
bind:
create_host_path: true
- type: bind
source: /DATA/AppData/bzod/www
source: /DATA/AppData/nx9-url-shortener/www
target: /app/www
bind:
create_host_path: true
- type: bind
source: /DATA/AppData/bzod/images
source: /DATA/AppData/nx9-url-shortener/images
target: /app/images
bind:
create_host_path: true
devices: []
cap_add: []
command: []
networks:
- default
privileged: false
cpu_shares: 90
networks:
default:
name: app_default
x-casaos:
author: self
category: self