diff --git a/.dockerignore b/.dockerignore index 108c1db..a809847 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,12 @@ node_modules/ dist/ .git/ +.backup/ +.vscode/ +devconfig/ +devdatabase/ +build-docker +otdebug.txt +plugins/* +!plugins/example-plugin/ +!plugins/example-plugin/** \ No newline at end of file diff --git a/.gitignore b/.gitignore index c6c9fe1..6eeaabc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ otdebug.txt !.tools/createContributors.ts !.tools/mergeTranslations.ts !.tools/docker-compose.yml -!.tools/dockerfile \ No newline at end of file +!.tools/build-docker.sh \ No newline at end of file diff --git a/build-docker.sh b/.tools/build-docker.sh similarity index 70% rename from build-docker.sh rename to .tools/build-docker.sh index aa9077a..808c652 100755 --- a/build-docker.sh +++ b/.tools/build-docker.sh @@ -8,8 +8,12 @@ set -euo pipefail +cd "$(dirname "$0")/.." +echo "✅ Switched working directory to Open Ticket root" +pwd + IMAGE="${1:?Usage: ./build-docker.sh [--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") # Create a multi-arch builder if it doesn't exist yet @@ -24,9 +28,10 @@ docker buildx build \ --platform "$PLATFORMS" \ --tag "${IMAGE}:v${VERSION}" \ --tag "${IMAGE}:latest" \ + --load \ $PUSH_FLAG \ . [[ -n "$PUSH_FLAG" ]] \ - && echo "✓ Pushed ${IMAGE}:v${VERSION} and ${IMAGE}:latest" \ - || echo "✓ Built ${IMAGE}:v${VERSION} (not pushed)" + && echo "✅ Pushed ${IMAGE}:v${VERSION} and ${IMAGE}:latest" \ + || echo "✅ Built ${IMAGE}:v${VERSION} (not pushed)" diff --git a/.tools/docker-compose.yml b/.tools/docker-compose.yml index 4b21a38..1788550 100644 --- a/.tools/docker-compose.yml +++ b/.tools/docker-compose.yml @@ -8,7 +8,6 @@ services: - plugins:/home/container/plugins restart: unless-stopped container_name: open-ticket - volumes: config: database: diff --git a/package.json b/package.json index 83b1c84..ffb7997 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "testnc": "node index.js --no-compile --dev-config --dev-database --soft-plugins", "tools:mergelang": "bun run .tools/mergeTranslations.js", "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", "license": "GPL-3.0-only",