Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkweon17 committed Mar 23, 2024
2 parents 8bc2ae2 + 4085f05 commit 001d59d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
command_timeout: 120m
envs: DB_DB, DB_HOST, DB_USER, DB_PASSWORD, DB_PORT, CR_REGISTRY, CR_USERNAME, CR_PASSWORD
script: |
CONTAINERS=$(docker ps -q)
Expand Down
54 changes: 31 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,45 @@ 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 \
# Install required packages and utilities for Chrome and Chromedriver
# Install required packages for Google Chrome and wget to download Chrome and Chromedriver
RUN apt-get update -qqy && apt-get -qqy install \
wget \
unzip \
libglib2.0-0 \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-1-3 \
libgdk-pixbuf-2.0-0 \
libnspr4 \
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/*
libxkbcommon0 \
libxrandr2 \
xdg-utils \
libu2f-udev \
libvulkan1 \
libgbm1 \
libgtk-3-0

# Install Chrome
# Download and install Google 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
&& apt install -y ./google-chrome-stable_current_amd64.deb \
&& rm google-chrome-stable_current_amd64.deb

# 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 \
&& ln -s /usr/bin/google-chrome /usr/bin/chrome
# Set ChromeDriver version
ENV CHROMEDRIVER_VERSION 114.0.5735.90

# Download and install ChromeDriver
RUN wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \
&& unzip /chromedriver/chromedriver* -d /usr/local/bin/ \
&& rm /chromedriver/chromedriver_linux64.zip

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Copy the entire FastAPI project to the container
COPY /src /app
Expand Down
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DB_Settings(BaseSettings):
db_db: str = os.getenv("DB_DB")
db_host: str = os.getenv("DB_HOST")
db_password: str = os.getenv("DB_PASSWORD")
db_port: int = int(os.getenv("DB_PORT"))
db_port: int = os.getenv("DB_PORT")
db_user: str = os.getenv("DB_USER")


Expand Down
2 changes: 2 additions & 0 deletions src/utils/web_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager


def get_webpage_content(url):
# Setup WebDriver
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
Expand All @@ -12,6 +13,7 @@ def get_webpage_content(url):
driver.get(url)



# Wait a bit for the page to load
time.sleep(2)

Expand Down

0 comments on commit 001d59d

Please sign in to comment.