Skip to content

Commit 92276ea

Browse files
authored
Merge pull request #24 from tosumitdhaka/fix/multi-platform-arm64
fix: add multi-platform (linux/amd64 + linux/arm64) support
2 parents 0d94209 + 36d3ed7 commit 92276ea

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/ghcr-publish.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
run: |
3131
grep -vE '^\s*#' .env | grep -vE '^\s*$' >> "$GITHUB_ENV"
3232
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
3339
- name: Login to GHCR
3440
uses: docker/login-action@v3
3541
with:
@@ -43,7 +49,7 @@ jobs:
4349
context: ${{ matrix.context }}
4450
file: ${{ matrix.dockerfile }}
4551
push: true
52+
platforms: linux/amd64,linux/arm64
4653
tags: |
4754
${{ matrix.image }}:latest
4855
${{ matrix.image }}:${{ env.APP_VERSION }}
49-

docker-compose.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44
# C2: added healthcheck on backend — frontend waits for FastAPI to be ready
55
# before nginx starts proxying, preventing 502 on first page load
66
# C3: use python urllib for healthcheck — curl not present in python:3.10-slim
7-
# C4: increased healthcheck interval 10s30s — 10s was generating excessive
7+
# C4: increased healthcheck interval 10s->30s — 10s was generating excessive
88
# uvicorn access log noise with no operational benefit post-startup
9+
# Platform fix:
10+
# Added platform: linux/arm64 — ensures native execution on Apple Silicon / ARM hosts
11+
# without QEMU emulation, preventing container crash-loop (exit 255)
912

1013
services:
1114
backend:
12-
build: ./backend
15+
image: ghcr.io/tosumitdhaka/trishul-snmp-backend:latest
16+
platform: linux/arm64
1317
container_name: trishul-snmp-backend
1418
env_file:
1519
- .env
@@ -38,8 +42,6 @@ services:
3842
# Auto-Start flags (Part A)
3943
- AUTO_START_SIMULATOR=${AUTO_START_SIMULATOR:-true}
4044
- AUTO_START_TRAP_RECEIVER=${AUTO_START_TRAP_RECEIVER:-true}
41-
# C2/C3/C4: healthcheck using python stdlib — no curl needed in slim image.
42-
# interval: 30s is plenty for a running container; start_period handles startup.
4345
healthcheck:
4446
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
4547
interval: 30s
@@ -49,11 +51,11 @@ services:
4951
restart: always
5052

5153
frontend:
52-
build: ./frontend
54+
image: ghcr.io/tosumitdhaka/trishul-snmp-frontend:latest
55+
platform: linux/arm64
5356
container_name: trishul-snmp-frontend
5457
ports:
5558
- "8080:80"
56-
# C2: wait for backend to pass healthcheck before starting nginx
5759
depends_on:
5860
backend:
5961
condition: service_healthy

0 commit comments

Comments
 (0)