arm dist
This commit is contained in:
1 parent
7b117d938f
commit
d3b446685f
6 files changed
+1552
-509
No files matched your search
Executable
+44
@@ -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"
|
||||
@@ -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:
|
||||
@@ -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
|
||||
Reference in new issue
Block a user