File tree Expand file tree Collapse file tree 4 files changed +24
-10
lines changed
Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,8 @@ name: Build
1414jobs :
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
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
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
Original file line number Diff line number Diff line change 1+ frontend /node_modules /
Original file line number Diff line number Diff line change 1+ import time
2+
13from fastapi import FastAPI
24from fastapi .middleware .cors import CORSMiddleware
35from pydantic import BaseModel
4- import time
6+ from pydantic import constr
7+
58
69app = FastAPI ()
710app .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
1619class InputData (BaseModel ):
17- name : str
20+ name : constr ( min_length = 1 , max_length = 200 )
1821
1922
2023# Output data model
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments