Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ poetry.lock
.DS_Store
Thumbs.db

# ---- Docker ----
/docker-compose.override.yml
**/.dockerignore
**/Dockerfile


# ---- Tests / Coverage ----
htmlcov/
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.10-slim

# 1. 작업 디렉토리 설정
WORKDIR /app

# 2. requirements.txt만 먼저 복사 (캐시 활용)
COPY requirements.txt .

# 3. 패키지 설치
RUN pip install --no-cache-dir -r requirements.txt

# 4. 실제 코드 복사 (변경 가능성이 높기 때문에 나중에 복사해야 pip 캐시 유지됨)
COPY app ./app

# 5. PYTHONPATH 환경변수 설정 (모듈 import를 위해)
ENV PYTHONPATH=/app

# 6. FastAPI 서버 실행
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
9 changes: 2 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,9 @@ async def sentences_endpoint(payload: SentencesRequest = Body(...)):
raise HTTPException(status_code=400, detail="text 또는 paragraphs 중 하나는 필요합니다.")

# 전체 원문
whole_text = payload.text or " ".join(payload.paragraphs or [])
whole_text = payload.text
# 문장 분리
if payload.paragraphs:
sents = []
for para in payload.paragraphs:
sents.extend(split_sentences(para))
else:
sents = split_sentences(whole_text)
sents = split_sentences(whole_text)

return SentencesResponse(text=whole_text, sentences=sents)

Expand Down