Skip to content

Commit 3d6d40e

Browse files
committed
Add multiarch image builds again
Signed-off-by: Tim Beermann <[email protected]>
1 parent bb7d327 commit 3d6d40e

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ name: Build
1414
jobs:
1515
build:
1616
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
platforms:
20-
- linux/amd64
21-
#- linux/arm64
17+
env:
18+
PLATFORMS: linux/amd64, linux/arm64
2219
permissions:
2320
packages: write
2421
contents: read
@@ -37,7 +34,7 @@ jobs:
3734
with:
3835
image: ghcr.io/berryit/backend:latest
3936
tags: ghcr.io/berryit/backend:latest
40-
platforms: ${{ matrix.platforms }}
37+
platforms: ${{ env.PLATFORMS }}
4138
containerfiles: |
4239
./backend/Containerfile
4340
context: ./backend
@@ -57,7 +54,7 @@ jobs:
5754
with:
5855
image: ghcr.io/berryit/frontend:latest
5956
tags: ghcr.io/berryit/frontend:latest
60-
platforms: ${{ matrix.platforms }}
57+
platforms: ${{ env.PLATFORMS }}
6158
containerfiles: |
6259
./frontend/Containerfile
6360
context: ./frontend

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frontend/node_modules/

backend/backend.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
import time
2+
13
from fastapi import FastAPI
24
from fastapi.middleware.cors import CORSMiddleware
35
from pydantic import BaseModel
4-
import time
6+
from pydantic import constr
7+
58

69
app = FastAPI()
710
app.add_middleware(
811
CORSMiddleware,
9-
allow_origins=["*"], # For development only; restrict in prod
12+
allow_origin_regex=".*frontend.*",
1013
allow_methods=["*"],
1114
allow_headers=["*"],
1215
)
1316

1417

1518
# Input data model
1619
class InputData(BaseModel):
17-
name: str
20+
name: constr(min_length=1, max_length=200)
1821

1922

2023
# Output data model

container-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
service:
2+
backend:
3+
image: ghcr.io/berryit/backend:latest
4+
platform: linux/arm64
5+
frontend:
6+
image: ghcr.io/berryit/frontend:latest
7+
platform: linux/arm64
8+
ports:
9+
- "3000:3000"
10+
environment:
11+
BACKEND_URL: "http://backend:8000"
12+
depends_on:
13+
- backend

0 commit comments

Comments
 (0)