refactor: move Docker build files to build/ directory
This commit is contained in:
72
build/Dockerfile
Normal file
72
build/Dockerfile
Normal file
@ -0,0 +1,72 @@
|
||||
# ###################################################################
|
||||
# Dockerfile - FGTools
|
||||
# ###################################################################
|
||||
# 퍼스트가든 통합 도구 Docker 이미지
|
||||
# ###################################################################
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
LABEL maintainer="dev@firstgarden.co.kr"
|
||||
LABEL description="FGTools - First Garden 통합 도구"
|
||||
|
||||
# 환경변수 설정
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV TZ=Asia/Seoul
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# 시스템 패키지 설치 (vim + 한글 지원 + 타임존)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
vim \
|
||||
locales \
|
||||
tzdata \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone
|
||||
|
||||
# 한글 로케일 설정
|
||||
RUN sed -i '/ko_KR.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||
locale-gen ko_KR.UTF-8
|
||||
ENV LANG=ko_KR.UTF-8
|
||||
ENV LC_ALL=ko_KR.UTF-8
|
||||
|
||||
# vim 설정 (visual mode 비활성화 + 한글 지원)
|
||||
RUN echo 'set mouse-=a' >> /etc/vim/vimrc.local && \
|
||||
echo 'set encoding=utf-8' >> /etc/vim/vimrc.local && \
|
||||
echo 'set fileencodings=utf-8,cp949,euc-kr' >> /etc/vim/vimrc.local && \
|
||||
echo 'set termencoding=utf-8' >> /etc/vim/vimrc.local
|
||||
|
||||
# Python 의존성 설치
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt && \
|
||||
pip install --no-cache-dir gunicorn
|
||||
|
||||
# 애플리케이션 코드 복사
|
||||
COPY core/ ./core/
|
||||
COPY services/ ./services/
|
||||
COPY apps/ ./apps/
|
||||
COPY *.py ./
|
||||
|
||||
# 로그 및 데이터 디렉토리 생성
|
||||
RUN mkdir -p /app/logs /app/data /app/conf
|
||||
|
||||
# 헬스체크
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:${FLASK_PORT:-5000}/api/dashboard/health || exit 1
|
||||
|
||||
# 기본 포트 노출
|
||||
EXPOSE 5000 5001 5002
|
||||
|
||||
# 엔트리포인트
|
||||
COPY build/docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["dashboard"]
|
||||
Reference in New Issue
Block a user