-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathDockerfile
48 lines (36 loc) · 1009 Bytes
/
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
FROM alpine:3.9
# greet me :)
MAINTAINER Tobias Rös - <[email protected]>
# install dependencies
RUN apk update && apk add \
bash \
git \
nodejs \
nodejs-npm \
nginx \
nginx-mod-http-lua \
python3 \
py-pip
RUN pip install speedtest-cli
# remove default content
RUN rm -R /var/www/*
# create directory structure
RUN mkdir -p /etc/nginx
RUN mkdir -p /run/nginx
RUN mkdir -p /etc/nginx/global
RUN mkdir -p /var/www/html
# touch required files
RUN touch /var/log/nginx/access.log && touch /var/log/nginx/error.log
# install vhost config
ADD ./config/vhost.conf /etc/nginx/conf.d/default.conf
ADD config/nginxEnv.conf /etc/nginx/modules/nginxEnv.conf
# install webroot files
ADD ./ /var/www/html/
# install bower dependencies
RUN npm install -g yarn && cd /var/www/html/ && yarn install
EXPOSE 80
EXPOSE 443
RUN chown -R nginx:nginx /var/www/html/
RUN chmod +x /var/www/html/config/run.sh
RUN chmod 755 /var/www/html/scripts/speedtestRunner.py
ENTRYPOINT ["/var/www/html/config/run.sh"]