55 lines
1.7 KiB
Plaintext
55 lines
1.7 KiB
Plaintext
FROM python:3.10-slim
|
|
|
|
ENV LANG=ko_KR.UTF-8 \
|
|
LANGUAGE=ko_KR:ko \
|
|
LC_ALL=ko_KR.UTF-8 \
|
|
TZ=Asia/Seoul \
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
# 필수 패키지 설치
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
locales tzdata bash cron curl unzip wget gnupg ca-certificates \
|
|
xvfb x11-utils libglib2.0-0 libnss3 libgconf-2-4 libfontconfig1 \
|
|
libxss1 libxshmfence1 libasound2 libxtst6 libappindicator3-1 \
|
|
fonts-nanum libu2f-udev \
|
|
libjpeg-dev zlib1g-dev && \
|
|
sed -i '/ko_KR.UTF-8/s/^# //g' /etc/locale.gen && \
|
|
locale-gen && \
|
|
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \
|
|
ln -sf /usr/bin/python3 /usr/bin/python && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
# Chrome 설치
|
|
RUN curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-linux-keyring.gpg && \
|
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
|
|
> /etc/apt/sources.list.d/google-chrome.list && \
|
|
apt-get update && \
|
|
apt-get install -y google-chrome-stable && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Python 패키지 설치
|
|
RUN pip install --no-cache-dir \
|
|
selenium>=4.10 \
|
|
pymysql \
|
|
ftputil \
|
|
pillow \
|
|
pyvirtualdisplay \
|
|
requests
|
|
|
|
# 작업 디렉토리 설정
|
|
WORKDIR /data
|
|
|
|
# 글꼴 캐시
|
|
RUN fc-cache -f -v
|
|
|
|
# 실행 스크립트 복사 및 실행 권한 부여
|
|
COPY run.sh /data/run.sh
|
|
RUN chmod +x /data/run.sh
|
|
|
|
# crontab 직접 등록
|
|
RUN echo "* * * * * /data/run.sh >> /proc/1/fd/1 2>&1" | crontab -
|
|
|
|
# 크론 실행
|
|
CMD ["bash", "-c", "cron -f"]
|