Docker improvements

This commit is contained in:
DJj123dj
2026-05-23 21:52:58 +02:00
parent 22d4caf03e
commit 66c5bc4565
5 changed files with 20 additions and 6 deletions
+9
View File
@@ -2,3 +2,12 @@
node_modules/ node_modules/
dist/ dist/
.git/ .git/
.backup/
.vscode/
devconfig/
devdatabase/
build-docker
otdebug.txt
plugins/*
!plugins/example-plugin/
!plugins/example-plugin/**
+1 -1
View File
@@ -23,4 +23,4 @@ otdebug.txt
!.tools/createContributors.ts !.tools/createContributors.ts
!.tools/mergeTranslations.ts !.tools/mergeTranslations.ts
!.tools/docker-compose.yml !.tools/docker-compose.yml
!.tools/dockerfile !.tools/build-docker.sh
+8 -3
View File
@@ -8,8 +8,12 @@
set -euo pipefail set -euo pipefail
cd "$(dirname "$0")/.."
echo "✅ Switched working directory to Open Ticket root"
pwd
IMAGE="${1:?Usage: ./build-docker.sh <image> [--no-push]}" IMAGE="${1:?Usage: ./build-docker.sh <image> [--no-push]}"
PLATFORMS="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64" # linux/s390x is taking too long to build, so we'll skip it for now PLATFORMS="linux/amd64,linux/arm64" # linux/arm/v6,linux/arm/v7,linux/s390x are taking too long to build, so we'll skip them for now
VERSION=$(node -p "require('./package.json').version") VERSION=$(node -p "require('./package.json').version")
# Create a multi-arch builder if it doesn't exist yet # Create a multi-arch builder if it doesn't exist yet
@@ -24,9 +28,10 @@ docker buildx build \
--platform "$PLATFORMS" \ --platform "$PLATFORMS" \
--tag "${IMAGE}:v${VERSION}" \ --tag "${IMAGE}:v${VERSION}" \
--tag "${IMAGE}:latest" \ --tag "${IMAGE}:latest" \
--load \
$PUSH_FLAG \ $PUSH_FLAG \
. .
[[ -n "$PUSH_FLAG" ]] \ [[ -n "$PUSH_FLAG" ]] \
&& echo "✓ Pushed ${IMAGE}:v${VERSION} and ${IMAGE}:latest" \ && echo "✅ Pushed ${IMAGE}:v${VERSION} and ${IMAGE}:latest" \
|| echo "✓ Built ${IMAGE}:v${VERSION} (not pushed)" || echo "✅ Built ${IMAGE}:v${VERSION} (not pushed)"
-1
View File
@@ -8,7 +8,6 @@ services:
- plugins:/home/container/plugins - plugins:/home/container/plugins
restart: unless-stopped restart: unless-stopped
container_name: open-ticket container_name: open-ticket
volumes: volumes:
config: config:
database: database:
+2 -1
View File
@@ -21,7 +21,8 @@
"testnc": "node index.js --no-compile --dev-config --dev-database --soft-plugins", "testnc": "node index.js --no-compile --dev-config --dev-database --soft-plugins",
"tools:mergelang": "bun run .tools/mergeTranslations.js", "tools:mergelang": "bun run .tools/mergeTranslations.js",
"tools:sponsors": "bun run .tools/createSponsors.ts", "tools:sponsors": "bun run .tools/createSponsors.ts",
"tools:contributors": "bun run .tools/createContributors.ts" "tools:contributors": "bun run .tools/createContributors.ts",
"docker:build":".tools/build-docker.sh djj123dj/open-ticket --no-push"
}, },
"type": "module", "type": "module",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",