Skip to content

Commit

Permalink
feat: web_crawler로 발생한 에러들 수정. 잘 배포되는지 테스트를 위한 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkweon17 committed Mar 23, 2024
1 parent 6f6998e commit 7973051
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,33 @@ COPY requirements/prod.txt requirements/prod.txt
# Install any needed packages specified in requirements files
RUN pip install --no-cache-dir -r requirements/prod.txt

# Install system dependencies for Chrome and ChromeDriver
RUN apt-get update && apt-get install -y \
wget \
unzip \
libglib2.0-0 \
libnss3 \
libgconf-2-4 \
libfontconfig1 \
libxi6 \
libxrender1 \
libxrandr2 \
libxfixes3 \
libxcursor1 \
libxinerama1 \
libxcomposite1 \
libasound2 \
libxdamage1 \
libxtst6 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*

# Install Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install

# Copy the entire FastAPI project to the container
COPY /src /app

Expand All @@ -20,4 +47,4 @@ EXPOSE 8080
# ENV MY_ENV_VARIABLE=my_value

# Run main.py when the container launches
CMD uvicorn --host=0.0.0.0 --port 8080 main:app
CMD ["uvicorn", "--host=0.0.0.0", "--port=8080", "main:app"]
1 change: 1 addition & 0 deletions src/utils/web_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time

def get_title_and_content_selenium(url):
driver = None
try:
# Selenium 설정: 머리 없는(headless) 브라우저로 설정
chrome_options = Options()
Expand Down

0 comments on commit 7973051

Please sign in to comment.