forked from RationaleEmotions/just-ask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (66 loc) · 2.26 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#========================
# Build
#========================
FROM maven:3.5.0-jdk-8-alpine as BUILDER
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY pom.xml /usr/src/app
# get all the downloads out of the way
RUN mvn -B -V -s /usr/share/maven/ref/settings-docker.xml help:system verify clean --fail-never
RUN mkdir -p /usr/src/app/target
RUN echo $(mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec) > target/project.version
COPY src /usr/src/app/src
RUN mvn -B -V -e -s /usr/share/maven/ref/settings-docker.xml help:system install -DskipTests=true -Dmaven.javadoc.skip=true
RUN cp target/just-ask-$(cat target/project.version)-jar-with-dependencies.jar target/just-ask-jar-with-dependencies.jar
#========================
# Docker image
#========================
FROM selenium/base:3.6.0-americium
LABEL maintainer="[email protected]"
USER seluser
#========================
# Docker Configuration
#========================
RUN sudo groupadd docker &&\
sudo usermod -aG docker seluser &&\
sudo usermod -aG staff seluser
#========================
# Just Ask library
#========================
COPY --from=BUILDER /usr/src/app/target/project.version /opt/selenium/just-ask.version
COPY --from=BUILDER /usr/src/app/target/just-ask-jar-with-dependencies.jar /opt/selenium/
#========================
# Selenium Configuration
#========================
EXPOSE 4444
ENV SCREEN_WIDTH 1360
ENV SCREEN_HEIGHT 1020
ENV SCREEN_DEPTH 24
ENV NODE_DEBUG false
ENV NODE_MEMORY 256m
# As integer, maps to "maxSession"
ENV GRID_MAX_SESSION 5
# In milliseconds, maps to "newSessionWaitTimeout"
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
# As a boolean, maps to "throwOnCapabilityNotPresent"
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
# As an integer
ENV GRID_JETTY_MAX_THREADS -1
# In milliseconds, maps to "cleanUpCycle"
ENV GRID_CLEAN_UP_CYCLE 5000
# In seconds, maps to "browserTimeout"
ENV GRID_BROWSER_TIMEOUT 0
# In seconds, maps to "timeout"
ENV GRID_TIMEOUT 30
# Debug
ENV GRID_DEBUG false
COPY generate_config \
entry_point.sh \
/opt/bin/
RUN sudo chmod +x /opt/bin/generate_config /opt/bin/entry_point.sh
RUN /opt/bin/generate_config > /opt/selenium/config.json
CMD ["/opt/bin/entry_point.sh"]