.env에서 서버 바인딩(HOST/PORT/LOG_LEVEL/RELOAD) 받아오기
- config.Settings에 host/port/log_level/reload 필드 추가
- app/main.py에 main() + __main__ 진입점 추가 (python -m app.main)
- Dockerfile: python:3.13-slim 베이스로, CMD를 python -m app.main 으로 변경
- docker-compose: env_file 사용, ports를 ${PORT} 변수화
- 환경변수 PORT=N 으로 override 가능 (uvicorn 직접 실행도 그대로 지원)
This commit is contained in:
1 parent
bc40ace2fd
commit
f31ef142e8
6 files changed
+71
-14
No files matched your search
+7
-4
@@ -2,13 +2,16 @@ services:
|
||||
plagiarism-api:
|
||||
build: .
|
||||
container_name: o2o-plagiarism-api
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "${PORT:-8000}:${PORT:-8000}"
|
||||
environment:
|
||||
API_KEYS: ${API_KEYS:-combooks-key-change-me,baikal-key-change-me}
|
||||
ENGINE_VERSION: ${ENGINE_VERSION:-o2o-plagiarism-1.0.0-baseline}
|
||||
HOST: ${HOST:-0.0.0.0}
|
||||
PORT: ${PORT:-8000}
|
||||
REFERENCE_CORPUS_DIR: /app/data/reference
|
||||
SIMILARITY_THRESHOLD: ${SIMILARITY_THRESHOLD:-0.30}
|
||||
TAXONOMY_DIR: /app/data/taxonomy
|
||||
AUTOBIOGRAPHY_PATTERNS_PATH: /app/data/autobiography/common_patterns.txt
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
restart: unless-stopped
|
||||
Reference in new issue
Block a user