From c3088e042d6408cc900afebe4a989aba4809aeb7 Mon Sep 17 00:00:00 2001 From: KWON Date: Tue, 24 Jun 2025 17:16:08 +0900 Subject: [PATCH] update Dockerfile --- build/Dockerfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 719b09c..40d3d4b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,29 +1,29 @@ FROM ubuntu:22.04 -# 패키지 설치 +ENV DEBIAN_FRONTEND=noninteractive + +# 필수 패키지 설치 및 크롬 설치를 한 RUN 명령어로 통합 RUN apt-get update && \ - apt-get install -y python3 python3-pip cron curl unzip wget xvfb \ + apt-get install -y --no-install-recommends \ + python3 python3-pip cron curl unzip wget xvfb \ libglib2.0-0 libnss3 libgconf-2-4 libfontconfig1 libxss1 libxshmfence1 \ libasound2 libxtst6 libappindicator3-1 fonts-liberation libu2f-udev && \ - pip3 install pymysql ftputil pillow selenium - -# 크롬 및 드라이버 설치 -RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ apt-get install -y ./google-chrome-stable_current_amd64.deb && \ - rm google-chrome-stable_current_amd64.deb + rm google-chrome-stable_current_amd64.deb && \ + rm -rf /var/lib/apt/lists/* -RUN CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+') && \ - wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROME_VERSION}/chromedriver_linux64.zip && \ - unzip /tmp/chromedriver.zip -d /usr/local/bin && \ - chmod +x /usr/local/bin/chromedriver && \ - rm /tmp/chromedriver.zip +# 파이썬 패키지 설치 +RUN pip3 install --no-cache-dir \ + selenium>=4.10 pymysql ftputil pillow # 작업 디렉토리 설정 WORKDIR /data -# 크론탭 등록 +# 크론탭 설정 COPY ./build/crontab.txt /etc/cron.d/autoupload-cron RUN chmod 0644 /etc/cron.d/autoupload-cron && \ crontab /etc/cron.d/autoupload-cron -CMD ["cron", "-f"] \ No newline at end of file +# 기본 명령 +CMD ["cron", "-f"]