This repository was archived by the owner on Aug 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (37 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
44 lines (37 loc) · 1.48 KB
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
FROM kimbtechnologies/php_nginx:php-7.4.2
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.10/community" > /etc/apk/repositories \
&& echo "http://dl-4.alpinelinux.org/alpine/v3.10/main" >> /etc/apk/repositories \
&& apk update \
&& apk add python3 \
&& apk add chromium=77.0.3865.120-r0 \
&& apk add chromium-chromedriver \
&& pip3 install selenium
RUN mkdir /py-code/ \
&& mkdir /py-code/drivers/ \
&& chown -R www-data:www-data /py-code/ \
&& mkdir /php-code/data/ \
&& chown -R www-data:www-data /php-code/data/ \
&& mkdir /php-code/client/ \
&& chown -R www-data:www-data /php-code/client/ \
&& echo $' \n\
# url rewriting error pages \n\
error_page 404 /index.php?uri=err404; \n\
error_page 403 /index.php?uri=err403; \n\
# protect private directories \n\
location ~ ^/(data){ \n\
deny all; \n\
return 403; \n\
} \n\
' > /etc/nginx/more-server-conf.conf
RUN wget -q "https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip" -O /tmp/chromedriver.zip \
&& unzip /tmp/chromedriver.zip -d /py-code/drivers/ \
&& rm /tmp/chromedriver.zip
RUN ln -s /usr/bin/chromium-browser \
&& chmod 777 /usr/bin/chromium-browser
COPY --chown=www-data:www-data ./py-code/ /py-code/
COPY --chown=www-data:www-data ./index.php /php-code/index.php
COPY --chown=www-data:www-data ./action.php /php-code/action.php
COPY --chown=www-data:www-data ./data/ /php-code/data/
COPY --chown=www-data:www-data ./client/ /php-code/client/
COPY ./setup.sh /startup-before.sh
ENV PROD=prod