diff options
author | Mike Crute <mcrute@gmail.com> | 2017-05-15 05:12:27 +0000 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2017-05-15 05:12:27 +0000 |
commit | 3f4c2c97ac9e791523e653d700fed58478abb3dd (patch) | |
tree | 693ad4c3abe1ce475c62d53dc15bbc6748c663d8 /bugzilla | |
parent | 3206d29307314a6c9c6db6a816fb1c269d69d122 (diff) | |
download | dockerfiles-3f4c2c97ac9e791523e653d700fed58478abb3dd.tar.bz2 dockerfiles-3f4c2c97ac9e791523e653d700fed58478abb3dd.tar.xz dockerfiles-3f4c2c97ac9e791523e653d700fed58478abb3dd.zip |
Add bugzilla dockerfile
Diffstat (limited to 'bugzilla')
-rw-r--r-- | bugzilla/Dockerfile | 126 | ||||
-rw-r--r-- | bugzilla/Makefile | 21 | ||||
-rwxr-xr-x | bugzilla/bin/dumb-init | bin | 0 -> 857208 bytes | |||
-rwxr-xr-x | bugzilla/bin/su-exec | bin | 0 -> 15752 bytes | |||
-rw-r--r-- | bugzilla/etc/cron.d/bugzilla | 3 | ||||
-rw-r--r-- | bugzilla/etc/nginx/sites-available/bugzilla | 41 | ||||
-rwxr-xr-x | bugzilla/etc/service/bugzilla/log/run | 3 | ||||
-rwxr-xr-x | bugzilla/etc/service/bugzilla/run | 4 | ||||
-rwxr-xr-x | bugzilla/etc/service/cron/log/run | 3 | ||||
-rwxr-xr-x | bugzilla/etc/service/cron/run | 3 | ||||
-rwxr-xr-x | bugzilla/etc/service/nginx/log/run | 3 | ||||
-rwxr-xr-x | bugzilla/etc/service/nginx/run | 3 | ||||
-rwxr-xr-x | bugzilla/etc/service/syslog-ng/run | 3 | ||||
-rw-r--r-- | bugzilla/etc/syslog-ng/syslog-ng.conf | 6 |
14 files changed, 219 insertions, 0 deletions
diff --git a/bugzilla/Dockerfile b/bugzilla/Dockerfile new file mode 100644 index 0000000..2aa4d04 --- /dev/null +++ b/bugzilla/Dockerfile | |||
@@ -0,0 +1,126 @@ | |||
1 | FROM ubuntu:16.04 | ||
2 | MAINTAINER Michael Crute <mike@crute.us> | ||
3 | |||
4 | ADD binaries/ /tmp/ | ||
5 | |||
6 | RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
7 | echo 'Acquire::http::Proxy "http://genesis.sea1.crute.me:3142";' > /etc/apt/apt.conf && \ | ||
8 | apt-get update && \ | ||
9 | |||
10 | # Configure timezone | ||
11 | rm /etc/localtime && \ | ||
12 | echo "America/Los_Angeles" > /etc/timezone && \ | ||
13 | dpkg-reconfigure -f noninteractive tzdata && \ | ||
14 | |||
15 | # Perl needs the UTF-8 locale | ||
16 | locale-gen en_US.UTF-8 && \ | ||
17 | |||
18 | # Install system dependencies | ||
19 | apt-get install -y \ | ||
20 | python-boto3 \ | ||
21 | cron \ | ||
22 | runit \ | ||
23 | nginx \ | ||
24 | syslog-ng \ | ||
25 | && \ | ||
26 | |||
27 | # Install Bugzilla dependencies | ||
28 | apt-get install -y \ | ||
29 | graphviz \ | ||
30 | libappconfig-perl \ | ||
31 | libauthen-radius-perl \ | ||
32 | libauthen-sasl-perl \ | ||
33 | libcache-memcached-fast-perl \ | ||
34 | libcgi-pm-perl \ | ||
35 | libchart-perl \ | ||
36 | libdaemon-generic-perl \ | ||
37 | libdate-calc-perl \ | ||
38 | libdatetime-perl \ | ||
39 | libdatetime-timezone-perl \ | ||
40 | libdbd-mysql-perl \ | ||
41 | libdbd-sqlite3-perl \ | ||
42 | libdbi-perl \ | ||
43 | libemail-mime-perl \ | ||
44 | libemail-reply-perl \ | ||
45 | libemail-sender-perl \ | ||
46 | libencode-detect-perl \ | ||
47 | libfile-copy-recursive-perl \ | ||
48 | libfile-mimeinfo-perl \ | ||
49 | libfile-slurp-perl \ | ||
50 | libfile-which-perl \ | ||
51 | libgd-graph-perl \ | ||
52 | libhtml-formattext-withlinks-perl \ | ||
53 | libhtml-scrubber-perl \ | ||
54 | libjson-rpc-perl \ | ||
55 | libmath-random-isaac-perl \ | ||
56 | libmath-random-isaac-xs-perl \ | ||
57 | libmime-tools-perl \ | ||
58 | libmodule-build-perl \ | ||
59 | libmoox-strictconstructor-perl \ | ||
60 | libnet-ldap-perl \ | ||
61 | libplack-perl \ | ||
62 | libsoap-lite-perl \ | ||
63 | libtemplate-perl \ | ||
64 | libtemplate-plugin-gd-perl \ | ||
65 | libtest-taint-perl \ | ||
66 | libtext-multimarkdown-perl \ | ||
67 | libtheschwartz-perl \ | ||
68 | liburi-db-perl \ | ||
69 | libxml-perl \ | ||
70 | libxml-twig-perl \ | ||
71 | perlmagick \ | ||
72 | python-sphinx \ | ||
73 | rst2pdf \ | ||
74 | && \ | ||
75 | |||
76 | dpkg -i /tmp/libpatchreader-perl_0.9.6-1_all.deb && \ | ||
77 | dpkg -i /tmp/libtheschwartz-perl_1.12-1_all.deb && \ | ||
78 | |||
79 | # Setup users and groups | ||
80 | groupadd -g 901 bugzilla && \ | ||
81 | usermod -a -G bugzilla www-data && \ | ||
82 | useradd -d /var/www/html/bugzilla -M -N -g bugzilla -s /bin/bash -u 901 bugzilla && \ | ||
83 | |||
84 | # Setup bugzilla app | ||
85 | mkdir -p /var/www/html && \ | ||
86 | mkdir /srv/bugzilla && \ | ||
87 | tar -C /var/www/html/ -xvzf /tmp/release-5.1.1.tar.gz && \ | ||
88 | ln -s /var/www/html/bugzilla-release-5.1.1 /var/www/html/bugzilla && \ | ||
89 | tar -C /var/www/html/bugzilla/skins/contrib/ -xvjf /tmp/Bright-Skin.tbz2 && \ | ||
90 | rm /etc/nginx/sites-enabled/default && \ | ||
91 | ln -s /etc/nginx/sites-available/bugzilla /etc/nginx/sites-enabled/bugzilla && \ | ||
92 | chown -R bugzilla:www-data /srv/bugzilla && \ | ||
93 | |||
94 | # Run the initial setup | ||
95 | # First time creates the config file | ||
96 | cd /var/www/html/bugzilla && ./checksetup.pl /tmp/answers.pl && \ | ||
97 | |||
98 | # Second time does the real setup | ||
99 | cd /var/www/html/bugzilla && ./checksetup.pl /tmp/answers.pl && \ | ||
100 | |||
101 | # Fix filesystem permissions | ||
102 | chown -R bugzilla:www-data /var/www/html/bugzilla-release-5.1.1 && \ | ||
103 | |||
104 | # Allow admin overrides | ||
105 | mv /var/www/html/bugzilla/data /srv/bugzilla/data && \ | ||
106 | mv /var/www/html/bugzilla/localconfig /srv/bugzilla/localconfig && \ | ||
107 | ln -s /srv/bugzilla/localconfig /var/www/html/bugzilla/localconfig && \ | ||
108 | ln -s /srv/bugzilla/data /var/www/html/bugzilla/data && \ | ||
109 | |||
110 | # Enable voting extension | ||
111 | rm /var/www/html/bugzilla/extensions/Voting/disabled && \ | ||
112 | |||
113 | # Clean up | ||
114 | rm /etc/apt/apt.conf && \ | ||
115 | apt-get clean && \ | ||
116 | rm -rf /var/lib/apt/lists/* && \ | ||
117 | rm -rf /tmp/* | ||
118 | |||
119 | ADD bin/ /usr/bin/ | ||
120 | ADD sbin/ /usr/sbin/ | ||
121 | ADD etc/ /etc/ | ||
122 | |||
123 | EXPOSE 80 | ||
124 | VOLUME "/srv/bugzilla" | ||
125 | STOPSIGNAL SIGHUP | ||
126 | CMD [ "/usr/bin/dumb-init", "/usr/bin/runsvdir", "/etc/service" ] | ||
diff --git a/bugzilla/Makefile b/bugzilla/Makefile new file mode 100644 index 0000000..392d933 --- /dev/null +++ b/bugzilla/Makefile | |||
@@ -0,0 +1,21 @@ | |||
1 | IMAGE=bugzilla:latest | ||
2 | RELEASE=release-5.1.1 | ||
3 | REPO=575365190010.dkr.ecr.us-west-2.amazonaws.com | ||
4 | |||
5 | all: | ||
6 | # curl -L -o binaries/$(RELEASE).tar.gz https://github.com/bugzilla/bugzilla/archive/$(RELEASE).tar.gz | ||
7 | docker build -t $(IMAGE) . | ||
8 | |||
9 | all-no-cache: | ||
10 | docker build --no-cache -t $(IMAGE) . | ||
11 | |||
12 | run: | ||
13 | docker run -d \ | ||
14 | -p 9000:80 \ | ||
15 | -v /srv/bugzilla:/srv/bugzilla \ | ||
16 | $(IMAGE) | ||
17 | |||
18 | publish: | ||
19 | eval $$(aws ecr get-login --region us-west-2) | ||
20 | docker tag $(IMAGE) $(REPO)/$(IMAGE) | ||
21 | docker push $(REPO)/$(IMAGE) | ||
diff --git a/bugzilla/bin/dumb-init b/bugzilla/bin/dumb-init new file mode 100755 index 0000000..4a41698 --- /dev/null +++ b/bugzilla/bin/dumb-init | |||
Binary files differ | |||
diff --git a/bugzilla/bin/su-exec b/bugzilla/bin/su-exec new file mode 100755 index 0000000..940f452 --- /dev/null +++ b/bugzilla/bin/su-exec | |||
Binary files differ | |||
diff --git a/bugzilla/etc/cron.d/bugzilla b/bugzilla/etc/cron.d/bugzilla new file mode 100644 index 0000000..8853366 --- /dev/null +++ b/bugzilla/etc/cron.d/bugzilla | |||
@@ -0,0 +1,3 @@ | |||
1 | 5 0 * * * bugzilla cd /var/www/html/bugzilla && ./collectstats.pl | ||
2 | */15 * * * * bugzilla cd /var/www/html/bugzilla && ./whine.pl | ||
3 | 0 * * * * bugzilla cd /var/www/html/bugzilla && ./whineatnews.pl | ||
diff --git a/bugzilla/etc/nginx/sites-available/bugzilla b/bugzilla/etc/nginx/sites-available/bugzilla new file mode 100644 index 0000000..d10798f --- /dev/null +++ b/bugzilla/etc/nginx/sites-available/bugzilla | |||
@@ -0,0 +1,41 @@ | |||
1 | server { | ||
2 | root /var/www/html/bugzilla; | ||
3 | |||
4 | autoindex off; | ||
5 | index index.cgi; | ||
6 | |||
7 | location /attachments { return 403; } | ||
8 | location /Bugzilla { return 403; } | ||
9 | location /lib { return 403; } | ||
10 | location /template { return 403; } | ||
11 | location /contrib { return 403; } | ||
12 | location /t { return 403; } | ||
13 | location /xt { return 403; } | ||
14 | location /data { return 403; } | ||
15 | location /graphs { return 403; } | ||
16 | location ~ (\.pm|\.pl|\.psgi|\.tmpl|localconfig.*|cpanfile)$ { return 403; } | ||
17 | |||
18 | location ~ ^/data/webdot/[^/]*\.png$ { } | ||
19 | location ~ ^/graphs/[^/]*\.(png|gif) { } | ||
20 | |||
21 | location /rest { | ||
22 | rewrite ^/rest/(.*)$ rest.cgi?$1 last; | ||
23 | } | ||
24 | |||
25 | location ~ \.(css|js)$ { | ||
26 | expires 1y; | ||
27 | add_header Cache-Control public; | ||
28 | } | ||
29 | |||
30 | location ~ \.cgi$ { | ||
31 | include fastcgi_params; | ||
32 | fastcgi_param SERVER_NAME 'bugs.crute.me'; | ||
33 | fastcgi_param SCRIPT_NAME ''; | ||
34 | fastcgi_param PATH_INFO $uri; | ||
35 | fastcgi_param BZ_CACHE_CONTROL 1; | ||
36 | fastcgi_pass localhost:9090; | ||
37 | } | ||
38 | |||
39 | gzip on; | ||
40 | gzip_types text/xml application/rdf+xml; | ||
41 | } | ||
diff --git a/bugzilla/etc/service/bugzilla/log/run b/bugzilla/etc/service/bugzilla/log/run new file mode 100755 index 0000000..c37e560 --- /dev/null +++ b/bugzilla/etc/service/bugzilla/log/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cat - | ||
diff --git a/bugzilla/etc/service/bugzilla/run b/bugzilla/etc/service/bugzilla/run new file mode 100755 index 0000000..1401cfe --- /dev/null +++ b/bugzilla/etc/service/bugzilla/run | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cd /var/www/html/bugzilla | ||
4 | /usr/bin/su-exec bugzilla:bugzilla /usr/bin/plackup -s FCGI --listen :9090 /var/www/html/bugzilla/app.psgi | ||
diff --git a/bugzilla/etc/service/cron/log/run b/bugzilla/etc/service/cron/log/run new file mode 100755 index 0000000..c37e560 --- /dev/null +++ b/bugzilla/etc/service/cron/log/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cat - | ||
diff --git a/bugzilla/etc/service/cron/run b/bugzilla/etc/service/cron/run new file mode 100755 index 0000000..dd49bb6 --- /dev/null +++ b/bugzilla/etc/service/cron/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | /usr/sbin/cron -f -n | ||
diff --git a/bugzilla/etc/service/nginx/log/run b/bugzilla/etc/service/nginx/log/run new file mode 100755 index 0000000..c37e560 --- /dev/null +++ b/bugzilla/etc/service/nginx/log/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cat - | ||
diff --git a/bugzilla/etc/service/nginx/run b/bugzilla/etc/service/nginx/run new file mode 100755 index 0000000..0a99b49 --- /dev/null +++ b/bugzilla/etc/service/nginx/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | /usr/sbin/nginx -g 'daemon off; master_process on;' | ||
diff --git a/bugzilla/etc/service/syslog-ng/run b/bugzilla/etc/service/syslog-ng/run new file mode 100755 index 0000000..c2b1cd1 --- /dev/null +++ b/bugzilla/etc/service/syslog-ng/run | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | /usr/sbin/syslog-ng -F --no-caps | ||
diff --git a/bugzilla/etc/syslog-ng/syslog-ng.conf b/bugzilla/etc/syslog-ng/syslog-ng.conf new file mode 100644 index 0000000..989fd46 --- /dev/null +++ b/bugzilla/etc/syslog-ng/syslog-ng.conf | |||
@@ -0,0 +1,6 @@ | |||
1 | @version: 3.5 | ||
2 | |||
3 | options { flush-lines(0); use-dns(no); stats-freq(0); }; | ||
4 | source s_src { unix-dgram("/dev/log" so-rcvbuf(8192)); internal(); }; | ||
5 | destination d_stdout { pipe("/dev/stdout"); }; | ||
6 | log { source(s_src); destination(d_stdout); }; | ||