Merge pull request #2321 from bluewave-labs/feat/arm-support

feat: arm dist
This commit is contained in:
Alexander Holliday
2025-05-22 09:21:19 -07:00
committed by GitHub
6 changed files with 1552 additions and 509 deletions

View File

@@ -0,0 +1,44 @@
name: Distribution deploy - Monolithic Multiarch
on:
push:
branches: ["master"]
workflow_dispatch:
jobs:
docker-build-and-push-server:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push multi-arch Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/dist-arm/server.Dockerfile
push: true
tags: ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch
platforms: linux/amd64,linux/arm64
labels: |
org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate
# - name: Build Server Docker image
# run: |
# docker build \
# -t ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch \
# -f ./docker/dist-arm/server.Dockerfile \
# --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
# .
# - name: Push Server Docker image
# run: docker push ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch

1895
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,21 +15,21 @@
"@emotion/styled": "^11.13.0",
"@fontsource/roboto": "^5.0.13",
"@hello-pangea/dnd": "^18.0.0",
"@mui/x-charts": "^7.5.1",
"@mui/x-data-grid": "7.29.0",
"@mui/x-date-pickers": "7.29.0",
"@mui/icons-material": "6.4.11",
"@mui/lab": "6.0.0-dev.240424162023-9968b4889d",
"@mui/material": "6.4.11",
"@mui/x-charts": "^7.5.1",
"@mui/x-data-grid": "7.29.0",
"@mui/x-date-pickers": "7.29.0",
"@reduxjs/toolkit": "2.7.0",
"axios": "^1.7.4",
"dayjs": "1.11.13",
"flag-icons": "7.3.2",
"jwt-decode": "^4.0.0",
"html2canvas": "^1.4.1",
"i18next": "^24.2.2",
"immutability-helper": "^3.1.1",
"joi": "17.13.3",
"jwt-decode": "^4.0.0",
"maplibre-gl": "5.3.1",
"mui-color-input": "^6.0.0",
"react": "18.3.1",
@@ -64,5 +64,8 @@
"eslint-plugin-react-refresh": "^0.4.6",
"prettier": "^3.3.3",
"vite": "^5.4.19"
},
"optionalDependencies": {
"@rollup/rollup-linux-arm64-musl": "4.41.0"
}
}

44
docker/dist-arm/build_images.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
set -e # Exit on error
# Change directory to root Server directory for correct Docker Context
cd "$(dirname "$0")"
cd ../..
# Ensure buildx builder exists and is used
if ! docker buildx inspect mybuilder &>/dev/null; then
docker buildx create --name mybuilder --use
else
docker buildx use mybuilder
fi
# Define service names and Dockerfiles
services=("mono_server_arm")
dockerfiles=(
"./docker/dist-arm/server.Dockerfile"
)
# Static image name for GitHub Container Registry (GHCR)
image="ghcr.io/bluewave-labs/checkmate:backend-dist-multi-arch"
platforms="linux/amd64,linux/arm64"
repo_url="https://github.com/bluewave-labs/checkmate"
# Loop through each service and build
for i in "${!services[@]}"; do
service="${services[$i]}"
dockerfile="${dockerfiles[$i]}"
echo "🚀 Building multi-arch image for $service..."
docker buildx build \
--platform "$platforms" \
-f "$dockerfile" \
-t "$image" \
--label "org.opencontainers.image.source=$repo_url" \
--push \
.
echo "$image pushed for platforms: $platforms"
done
echo "🎉 All multi-arch images built and pushed successfully"

View File

@@ -0,0 +1,42 @@
version: "3.8"
services:
server:
image: ghcr.io/bluewave-labs/checkmate:backend-dist-multi-arch
restart: always
ports:
- "52345:52345"
environment:
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
- UPTIME_APP_CLIENT_HOST=http://localhost
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db?replicaSet=rs0
- REDIS_URL=redis://redis:6379
- CLIENT_HOST=http://localhost
- JWT_SECRET=my_secret
depends_on:
- redis
- mongodb
redis:
image: redis:7
container_name: checkmate-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
mongodb:
image: mongo:4.4.18
container_name: checkmate-mongodb
restart: always
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
volumes:
- ./mongo/data:/data/db
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30
volumes:
redis_data:

View File

@@ -0,0 +1,25 @@
FROM node:20-alpine AS frontend-build
WORKDIR /app/client
COPY client/package*.json ./
RUN npm ci
COPY client ./
RUN npm run build
FROM node:20-alpine AS backend
WORKDIR /app/server
COPY server ./
COPY --from=frontend-build /app/client/dist ./public
RUN npm ci
RUN chmod +x ./scripts/inject-vars.sh
EXPOSE 52345
CMD ./scripts/inject-vars.sh && node ./index.js