-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM openjdk:8
# Install Chromium v73
RUN apt-get update && apt-get install -y chromium
# Set up gradle environment variables
ENV GRADLE_VERSION=5.6.1
ENV GRADLE_HOME=/opt/gradle
# Download gradle and chromedriver binaries
WORKDIR /tmp
RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip
RUN wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
# Unzip gradle binary
RUN mkdir ${GRADLE_HOME}
RUN unzip -d ${GRADLE_HOME} /tmp/gradle-${GRADLE_VERSION}-bin.zip
ENV PATH=${PATH}:${GRADLE_HOME}/gradle-${GRADLE_VERSION}/bin
# Copy repository contents into application folder
WORKDIR /app
COPY src /app/src
COPY build.gradle /app/build.gradle
COPY settings.gradle /app/settings.gradle
COPY gradlew /app/gradlew
COPY gradlew.bat /app/gradlew.bat
# Replace chromedriver binary with downloaded version
RUN unzip -d src/main/resources /tmp/chromedriver_linux64.zip
RUN mv src/main/resources/chromedriver src/main/resources/chromedriver_linux
# Nuke temporary folder
RUN rm -rf /tmp
ENTRYPOINT ["gradle", "run"]