Skip to content

chore: Docker Image 설정 및 docker-compose 설정 #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Python 3.10 slim 이미지 기반
FROM python:3.12-slim

# 시스템 라이브러리 설치
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*

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

# 의존성 파일 복사 및 설치
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 전체 서비스 코드 복사
COPY . .

# Python 환경 설정
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

# Streamlit 포트 노출
EXPOSE 8501

# Streamlit 실행 명령
CMD ["python", "-c", "from llm_utils.tools import set_gms_server; import os; set_gms_server(os.getenv('DATAHUB_SERVER', 'http://localhost:8080'))"]
CMD ["streamlit", "run", "./interface/streamlit_app.py", "--server.port=8501"]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
streamlit:
build: .
ports:
- "8501:8501"
volumes:
- .:/app
env_file:
- .env
environment:
- DATABASE_URL=postgresql://postgres:password@db:5432/streamlit_db
depends_on:
- db

db:
image: pgvector/pgvector:pg17
container_name: pgvector-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: streamlit_db
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./postgres/schema.sql:/docker-entrypoint-initdb.d/schema.sql
volumes:
pgdata: