Skip to content

Commit 94e7375

Browse files
Merge pull request #149 from CausalInferenceLab/148-fix-dockerfile
fix: 도커파일 이미지 빌드 실패현상 수정
2 parents 1d14b6d + e147aa3 commit 94e7375

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

Dockerfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# Python 3.10 slim 이미지 기반
2-
FROM python:3.12-slim
1+
# 1. Base image
2+
FROM python:3.12-slim-bullseye
33

4-
# 시스템 라이브러리 설치
4+
# 2. 시스템 라이브러리 설치
55
RUN apt-get update && apt-get install -y \
66
build-essential \
77
curl \
8-
software-properties-common \
98
git \
109
libpq-dev \
1110
&& rm -rf /var/lib/apt/lists/*
1211

13-
# 작업 디렉토리 설정
14-
WORKDIR /app
12+
# 3. uv 설치
13+
RUN pip install --no-cache-dir uv
1514

16-
# 의존성 파일 복사 및 설치
17-
COPY requirements.txt .
18-
RUN pip install --no-cache-dir -r requirements.txt
15+
# 4. 작업 디렉토리 설정
16+
WORKDIR /app
1917

20-
# 전체 서비스 코드 복사
18+
# 5. 소스 코드 복사 및 의존성 설치
19+
COPY pyproject.toml ./
2120
COPY . .
21+
RUN uv pip install --system --upgrade pip setuptools wheel \
22+
&& uv pip install --system .
2223

23-
# Python 환경 설정
24+
# 6. 환경 변수 설정
2425
ENV PYTHONPATH=/app
2526
ENV PYTHONUNBUFFERED=1
2627

27-
# Streamlit 포트 노출
28-
EXPOSE 8501
28+
# 7. 포트 설정
29+
ENV STREAMLIT_SERVER_PORT=8501
2930

30-
# Streamlit 실행 명령
31-
CMD ["python", "-c", "from llm_utils.tools import set_gms_server; import os; set_gms_server(os.getenv('DATAHUB_SERVER', 'http://localhost:8080'))"]
32-
CMD ["streamlit", "run", "./interface/streamlit_app.py", "--server.port=8501"]
31+
# 8. 실행 명령
32+
CMD ["lang2sql", "run-streamlit"]

cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
명령어 예시: lang2sql --datahub_server http://localhost:8080 --run-streamlit
66
"""
77

8-
import os
98
import logging
9+
import os
1010
import subprocess
1111

1212
import click

docker-compose.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
services:
22
streamlit:
3+
hostname: streamlit
4+
container_name: streamlit
35
build: .
46
ports:
57
- "8501:8501"
@@ -8,21 +10,24 @@ services:
810
env_file:
911
- .env
1012
environment:
11-
- DATABASE_URL=postgresql://postgres:password@db:5432/streamlit_db
13+
- STREAMLIT_SERVER_PORT=8501
14+
- DATABASE_URL=postgresql://pgvector:pgvector@pgvector:5432/streamlit
1215
depends_on:
13-
- db
16+
- pgvector
1417

15-
db:
18+
pgvector:
1619
image: pgvector/pgvector:pg17
17-
container_name: pgvector-db
20+
hostname: pgvector
21+
container_name: pgvector
1822
environment:
19-
POSTGRES_USER: postgres
20-
POSTGRES_PASSWORD: password
21-
POSTGRES_DB: streamlit_db
23+
POSTGRES_USER: pgvector
24+
POSTGRES_PASSWORD: pgvector
25+
POSTGRES_DB: streamlit
2226
ports:
2327
- "5432:5432"
2428
volumes:
2529
- pgdata:/var/lib/postgresql/data
2630
- ./postgres/schema.sql:/docker-entrypoint-initdb.d/schema.sql
31+
2732
volumes:
28-
pgdata:
33+
pgdata:

0 commit comments

Comments
 (0)