-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (38 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
53 lines (38 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM python:3.10-slim
# 환경변수 설정
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
TZ=Asia/Seoul \
GECKODRIVER_VERSION=0.36.0
# gzip 압축 우선 사용 설정 (lzma 오류 회피)
RUN echo 'Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/99custom
# 필수 패키지 및 Firefox 설치 (wget 추가)
RUN apt-get update && apt-get install -y \
wget \
firefox-esr \
libgtk-3-0 \
libdbus-glib-1-2 \
libx11-xcb1 \
libxt6 \
fonts-liberation \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Geckodriver 설치 (최신 버전)
RUN wget https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz \
&& tar -xzf geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz \
&& mv geckodriver /usr/local/bin/ \
&& chmod +x /usr/local/bin/geckodriver \
&& rm geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz
# 작업 디렉토리 설정
WORKDIR /app
# 의존성 파일을 복사하고 패키지 설치
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# 프로젝트 전체 복사 (이때 .env는 .gitignore에 있더라도 로컬에 존재하면 복사됨)
COPY . .
# logs 폴더 미리 생성
RUN mkdir -p logs
# 컨테이너 외부에서 접근할 포트를 명시합니다.
EXPOSE 5000
# 스크립트 실행
CMD ["python", "app.py"]