Skip to content
Open
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
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 가상환경
ict_2025/
venv/

# Python
__pycache__/
*.pyc
*.pyo

# 환경파일
.env

# OS 파일
.DS_Store

# MySQL 데이터
model/mysql/data/
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.10.5

RUN pip install --upgrade pip
WORKDIR /code

COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir -r /code/requirements.txt

COPY ./model /code/model

CMD ["uvicorn", "model.app.main:app", "--host", "0.0.0.0", "--port", "8000"]
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3.8"

services:
db:
image: mysql:8.0.29
container_name: mysql8029
ports:
- "3307:3306"
volumes:
- ./mysql/conf.d:/etc/mysql/conf.d
- ./mysql/data:/var/lib/mysql
env_file: .env
environment:
TZ: Asia/Seoul
restart: always

server:
build:
context: .
dockerfile: ./Dockerfile
container_name: fastapi-server
ports:
- "8000:8000"
env_file: .env
depends_on:
- db
restart: always
File renamed without changes.
16 changes: 16 additions & 0 deletions model/app/core/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pydantic import BaseSettings
from functools import lru_cache

class Settings(BaseSettings):
MYSQL_USER: str
MYSQL_PASSWORD: str
MYSQL_HOST: str
MYSQL_PORT: int
MYSQL_DATABASE: str

class Config:
env_file = ".env"

@lru_cache()
def get_setting():
return Settings()
13 changes: 13 additions & 0 deletions model/app/db/session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from ..core.config import get_setting

settings = get_setting()

SQLALCHEMY_DATABASE_URL = (
f"mysql+pymysql://{settings.MYSQL_USER}:{settings.MYSQL_PASSWORD}"
f"@{settings.MYSQL_HOST}:{settings.MYSQL_PORT}/{settings.MYSQL_DATABASE}"
)

engine = create_engine(SQLALCHEMY_DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
9 changes: 9 additions & 0 deletions model/app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
return {"message": "Hello FastAPI"}


10 changes: 10 additions & 0 deletions model/mysql/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
53 changes: 53 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# FastAPI 기본
fastapi>=0.112.0
uvicorn[standard]>=0.30.0
python-dotenv>=1.0.1
pydantic>=2.7.0
python-multipart>=0.0.9

# DB 연동
sqlalchemy>=2.0.30
pymysql>=1.1.0

# OpenAI & LangChain
openai>=1.40.0
tiktoken>=0.7.0
langchain>=0.2.10
langchain-community>=0.2.10
langchain-openai>=0.1.20
langchain-core==0.3.74
langchain-google-genai==2.1.9
langchain-google-vertexai==2.0.28
langchain-text-splitters==0.3.9
langsmith==0.4.14

# Vector DB & NLP
faiss-cpu>=1.8.0.post1
sentence-transformers>=3.0.1
chromadb>=0.5.5
pinecone-client>=4.1.0
qdrant-client>=1.9.1
pymilvus>=2.4.4

# 문서 처리
pypdf>=4.2.0
pdfplumber>=0.11.0
python-docx>=1.1.0

# 데이터 분석
numpy>=1.26.4
pandas>=2.2.2
scikit-learn>=1.5.1

# 오디오/비디오 처리
pydub>=0.25.1
soundfile>=0.12.1
ffmpeg-python>=0.2.0
faster-whisper>=1.0.0

# NLP 추가
sacrebleu>=2.4.0
nltk>=3.9

# 유틸
requests==2.32.4