Skip to content

fix(docker): Docker 배포 설정 오류 수정#49

Merged
Yoo-SH merged 6 commits into
developfrom
fix/48-docker-config-issues
Dec 15, 2025
Merged

fix(docker): Docker 배포 설정 오류 수정#49
Yoo-SH merged 6 commits into
developfrom
fix/48-docker-config-issues

Conversation

@qowlgur121

Copy link
Copy Markdown
Member

요약

Issue #48에서 보고된 Docker 환경 설정 오류를 수정했습니다.

변경 사항

1. Dockerfile 베이스 이미지 변경

  • openjdk:21-slim (존재하지 않음) -> eclipse-temurin:21-jre-jammy

2. application-docker.yml 수정

항목 변경 전 변경 후
DB URL localhost:5432 postgres:5432
DB 계정 postgres/3482 user/password
RAG URL localhost:8001 open-context-rag:8001
ES URL localhost:9200 elasticsearch:9200
Ollama URL localhost:11434 ollama:11434
MinIO URL localhost:9000 minio:9000
MinIO secret minioadmin minioadmin123!
spring.profiles.active dev 제거

3. docker-compose.yml 수정

4. .gitignore 추가

  • .cursor/ (IDE)
  • .gradle-user-home/ (Gradle 캐시)
  • __pycache__/, *.pyc, *.pyo (Python 캐시)

테스트

  • Docker Compose로 전체 서비스 실행 확인
  • Core 서비스 health check 통과
  • RAG 서비스 health check 통과

관련 이슈

Closes #48

Yoo-SH and others added 6 commits August 22, 2025 02:24
- Pull Request: develop → main
- First stable version ready for production
- rag pipeline fastapi에서 처리
- langchain과 결합
- elasticsearch 데이터 저장 for(keyword, vector)
- 백엔드에서는 rag 검색만 진행
- 키워드(파일원본,제목,본문)검색+백터검색 3/7
- unstructed io 관련설정 제거
- Dockerfile 베이스 이미지 변경 (openjdk:21-slim -> eclipse-temurin:21-jre-jammy)
- application-docker.yml에서 localhost를 Docker 서비스명으로 변경
- DB 자격증명을 docker-compose.yml과 일치시킴 (user/password)
- MinIO secret-key를 docker-compose.yml과 일치시킴
- 임베딩 모델을 bge-m3:latest로 통일
- profile-specific 파일에서 spring.profiles.active 제거
- IDE 및 빌드 아티팩트를 .gitignore에 추가

Closes #48
@Yoo-SH

Yoo-SH commented Dec 15, 2025

Copy link
Copy Markdown
Member

악.. 트롤짓 커버 감사합니다람쥐

@Yoo-SH
Yoo-SH merged commit d082cb1 into develop Dec 15, 2025
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Docker deployment configuration errors (Issue #48) by updating base images, migrating to a Python FastAPI-based RAG service, and correcting environment configurations for container networking.

  • Replaces non-existent openjdk:21-slim with eclipse-temurin:21-jre-jammy
  • Implements new Python RAG service with FastAPI, replacing direct Elasticsearch/Ollama integration in Java
  • Updates service URLs from localhost to Docker service names (postgres, elasticsearch, ollama, minio)

Reviewed changes

Copilot reviewed 38 out of 63 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
core/Dockerfile Updates base image to eclipse-temurin:21-jre-jammy
docker-compose.yml Adds RAG service, updates model to bge-m3:latest, removes unstructured-api
core/src/main/resources/application-docker.yml Configures service URLs for Docker networking, adds RAG service URL
core/src/main/resources/application.yml Updates local dev config with RAG service URL
core/src/main/java/com/opencontext/controller/SourceController.java Integrates RAG service via REST API
core/src/main/java/com/opencontext/service/FileStorageService.java Adds presigned URL generation for MinIO
core/src/main/java/com/opencontext/config/SecurityConfig.java Disables API key authentication (security risk)
rag/* Complete Python FastAPI RAG service implementation
.gitignore Adds .cursor/, .gradle-user-home/, pycache/
rag/**/pycache/* Python cache files incorrectly committed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rag/app/main.py
Comment on lines +30 to +32
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # In production, restrict to specific origins

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CORS middleware is configured to allow all origins ("*") with credentials enabled. This is a security risk in production as it allows any website to make authenticated requests to the API. Consider restricting allowed origins to specific domains or making this configurable via environment variables.

Copilot uses AI. Check for mistakes.
hibernate:
ddl-auto: validate
show-sql: true
ddl-auto: update

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ddl-auto setting has been changed from 'validate' to 'update' in the Docker configuration. This allows Hibernate to automatically modify the database schema, which can be dangerous in production as it may lead to unintended schema changes or data loss. Consider using 'validate' with proper Flyway migrations or making this environment-specific.

Suggested change
ddl-auto: update
ddl-auto: validate

Copilot uses AI. Check for mistakes.
# Flyway Configuration (Docker)
# Flyway Configuration
flyway:
baseline-on-migrate: true

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Flyway configuration locations and validate-on-migrate settings have been removed. This removes important database migration validation and could lead to deployment issues if migrations are not properly tracked. These settings should be retained to ensure database schema consistency.

Suggested change
baseline-on-migrate: true
baseline-on-migrate: true
locations: classpath:db/migration
validate-on-migrate: true

Copilot uses AI. Check for mistakes.
Comment thread rag/app/dependencies.py
Comment on lines +33 to +38
if settings.elasticsearch_url.startswith("https"):
client_params["verify_certs"] = settings.elasticsearch_verify_certs
if not settings.elasticsearch_verify_certs:
# Suppress SSL warnings in development
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The elasticsearch_verify_certs configuration defaults to True but SSL warnings are disabled when set to False. This suppresses important security warnings in development. Consider logging a warning message instead of completely disabling urllib3 warnings, so other security issues aren't masked.

Copilot uses AI. Check for mistakes.
Comment thread rag/app/main.py
Comment on lines +50 to +57
@app.exception_handler(Exception)
async def general_exception_handler(request: Request, exc: Exception):
"""Handle unexpected exceptions."""
logger.error(f"Unexpected error: {str(exc)}", exc_info=True)
return JSONResponse(
status_code=500,
content={"detail": "Internal server error"}
)

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handler catches all exceptions and returns a generic "Internal server error" message without logging the full exception details for security. However, this makes debugging production issues difficult. Consider adding a request ID to the response and logging it with full exception details server-side for troubleshooting.

Copilot uses AI. Check for mistakes.
Comment thread rag/app/main.py
import logging

from app.config.settings import settings
from app.utils.exceptions import RagServiceException, rag_exception_handler

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'rag_exception_handler' is not used.

Copilot uses AI. Check for mistakes.
Comment thread rag/app/api/v1/process.py
Internal API called by core/ service after file upload.
"""
import logging
from fastapi import APIRouter, HTTPException

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'HTTPException' is not used.

Suggested change
from fastapi import APIRouter, HTTPException
from fastapi import APIRouter

Copilot uses AI. Check for mistakes.
Comment thread rag/app/api/v1/process.py
from app.models.responses import ProcessResponse
from app.services.parsing import DocumentParsingService
from app.services.chunking import ChunkingService
from app.services.embedding import EmbeddingService

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'EmbeddingService' is not used.

Suggested change
from app.services.embedding import EmbeddingService

Copilot uses AI. Check for mistakes.
Comment thread rag/app/api/v1/process.py
from app.services.parsing import DocumentParsingService
from app.services.chunking import ChunkingService
from app.services.embedding import EmbeddingService
from app.services.indexing import IndexingService

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'IndexingService' is not used.

Suggested change
from app.services.indexing import IndexingService

Copilot uses AI. Check for mistakes.
Provides accurate token counting for content retrieval with truncation support.
"""
import tiktoken
from typing import Optional

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'Optional' is not used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants