Docker improvements
This commit is contained in:
@@ -2,3 +2,12 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.git/
|
||||
.backup/
|
||||
.vscode/
|
||||
devconfig/
|
||||
devdatabase/
|
||||
build-docker
|
||||
otdebug.txt
|
||||
plugins/*
|
||||
!plugins/example-plugin/
|
||||
!plugins/example-plugin/**
|
||||
+1
-1
@@ -23,4 +23,4 @@ otdebug.txt
|
||||
!.tools/createContributors.ts
|
||||
!.tools/mergeTranslations.ts
|
||||
!.tools/docker-compose.yml
|
||||
!.tools/dockerfile
|
||||
!.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 <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")
|
||||
|
||||
# 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)"
|
||||
@@ -8,7 +8,6 @@ services:
|
||||
- plugins:/home/container/plugins
|
||||
restart: unless-stopped
|
||||
container_name: open-ticket
|
||||
|
||||
volumes:
|
||||
config:
|
||||
database:
|
||||
|
||||
+2
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user