Skip to content

Commit

Permalink
Merge pull request #117 from teamSynapse6/develop
Browse files Browse the repository at this point in the history
fix: apt-get을 사용한 크롬드라이버 설치
  • Loading branch information
gyehwan24 authored Nov 3, 2024
2 parents 3c8645c + 330360e commit b3041ff
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM openjdk:17
# Debian 기반의 slim 이미지 사용
FROM openjdk:17-slim

# Chrome 및 ChromeDriver 설치
# Chrome 및 ChromeDriver 버전 설정
ENV CHROME_VERSION="115.0.5790.102-1"
ENV CHROMEDRIVER_VERSION="115.0.5790.102"

# 필요한 패키지를 apk로 설치
RUN apk update && apk add --no-cache wget unzip bash \
# 필요한 패키지를 apt-get으로 설치
RUN apt-get update && apt-get install -y wget unzip \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apk add --no-cache ./google-chrome-stable_current_amd64.deb \
&& apt-get install -y ./google-chrome-stable_current_amd64.deb \
&& rm ./google-chrome-stable_current_amd64.deb

# ChromeDriver 설치
Expand All @@ -17,16 +18,19 @@ RUN wget -O /tmp/chromedriver.zip "https://chromedriver.storage.googleapis.com/$
&& rm /tmp/chromedriver.zip

# Xvfb 설치 및 환경 변수 설정
RUN apk add --no-cache xvfb
RUN apt-get install -y xvfb
ENV DISPLAY=:99

# Chrome 및 ChromeDriver 경로 환경 변수 설정
ENV CHROME_BIN=/usr/bin/google-chrome
ENV CHROME_DRIVER=/usr/local/bin/chromedriver

# 애플리케이션 JAR 복사
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar

# 포트 노출
EXPOSE 8080

ENTRYPOINT ["sh", "-c", "Xvfb :99 -ac & java -jar /app.jar"]
# 애플리케이션 시작 명령어
ENTRYPOINT ["sh", "-c", "Xvfb :99 -ac & java -jar /app.jar"]

0 comments on commit b3041ff

Please sign in to comment.