구조: 내부 API 진입점을 admin/backend 로 옮긴다
admin/ 이 프론트만 있는 폴더였다. :9801 을 띄우는 코드는 solution/backend 안에 admin_main.py 로 얹혀 있었는데, 그러면 폴더만 봐서는 admin 에 백엔드가 있다는 걸 모른다. solution/backend/admin_main.py → admin/backend/main.py solution/backend/router/admin_router.py → admin/backend/app.py 도메인 코드는 여전히 복제하지 않는다 — `PYTHONPATH=/app/solution/backend` 한 줄이 두 폴더를 잇는다. admin/backend 에 있는 건 진입점 두 파일뿐이다. ## 이미지 빌드 컨텍스트를 레포 루트로 올렸다 진입점이 admin/ 에, 도메인 코드가 solution/ 에 있어서 한 이미지에 둘 다 들어와야 한다. 나누면 requirements 를 두 번 설치하게 된다. 컨텍스트가 넓어진 만큼 루트 .dockerignore 로 프론트·문서·테스트·시크릿을 잘라냈다(옛 solution/backend/.dockerignore 대체). 이미지 배치: /app/solution/backend ← 도메인 코드. api·worker 의 working_dir /app/admin/backend ← 내부 API 진입점. api-admin 의 working_dir 검증: api·api-admin 둘 다 healthy, 다섯 엔드포인트(9800·9801·3000·3002·80) 전부 200. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
This commit is contained in:
1 parent
c6b45fdda4
commit
cabcdeaacc
9 files changed
+84
-59
No files matched your search
+8
-7
@@ -31,8 +31,8 @@ x-common-env: &common-env
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: ./solution/backend
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: solution/backend/Dockerfile
|
||||
image: o2o-web4ai-backend
|
||||
container_name: o2o-web4ai-api
|
||||
command: ["python", "web_main.py"]
|
||||
@@ -55,8 +55,8 @@ services:
|
||||
|
||||
worker:
|
||||
build:
|
||||
context: ./solution/backend
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: solution/backend/Dockerfile
|
||||
image: o2o-web4ai-backend
|
||||
command: ["python", "worker_main.py"]
|
||||
env_file:
|
||||
@@ -83,13 +83,14 @@ services:
|
||||
driver: json-file
|
||||
options: { max-size: "10m", max-file: "5" }
|
||||
|
||||
# 내부 운영 API(:9801). 코드는 api 와 같은 이미지·같은 소스이고 진입점만 다르다
|
||||
# (admin_main.py → router/admin_router.py). place·fact 를 두 번 구현하지 않으면서
|
||||
# 내부 운영 API(:9801). 진입점은 admin/backend/{main,app}.py 이고 도메인 코드는
|
||||
# solution/backend 것을 PYTHONPATH 로 그대로 쓴다 — place·fact 를 두 번 구현하지 않으면서
|
||||
# 프로세스와 포트만 가른다. 여기 붙는 모든 엔드포인트는 role >= DEVELOPER 다.
|
||||
api-admin:
|
||||
image: o2o-web4ai-backend
|
||||
container_name: o2o-web4ai-api-admin
|
||||
command: ["python", "admin_main.py"]
|
||||
working_dir: /app/admin/backend
|
||||
command: ["python", "main.py"]
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
|
||||
Reference in new issue
Block a user