Skip to content

Instantly share code, notes, and snippets.

@dklawren
Created June 23, 2017 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dklawren/4b16798dfa330ef0f562a0f4eb38989d to your computer and use it in GitHub Desktop.
Save dklawren/4b16798dfa330ef0f562a0f4eb38989d to your computer and use it in GitHub Desktop.
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100755
index 0000000..6cfdd57
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,44 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+version: '2'
+services:
+ bmo.test:
+ build: .
+ environment:
+ - BMO_db_driver=mysql
+ - BMO_db_host=bmo.db
+ - BMO_db_name=bugs
+ - BMO_db_user=bugs
+ - BMO_db_pass=bugs
+ - BMO_site_wide_secret=bigsecret
+ - BMO_memcached_namespace=bugzilla
+ - BMO_memcached_servers=memcached
+ - BMO_apache_size_limit=700000
+ restart: on-failure
+ depends_on:
+ - bmo.db
+
+ bmo.db:
+ image: mysql:5.6
+ volumes:
+ - bmo-mysql-db:/var/lib/mysql
+ environment:
+ - MYSQL_DATABASE=bugs
+ - MYSQL_USER=bugs
+ - MYSQL_PASSWORD=bugs
+ - MYSQL_ALLOW_EMPTY_PASSWORD=1
+
+ tinyproxy:
+ build:
+ context: docker_files/tinyproxy
+ dockerfile: ./Dockerfile
+ ports:
+ - "1080:1080"
+
+ memcached:
+ image: memcached
+
+volumes:
+ bmo-mysql-db:
diff --git a/docker_files/checksetup_answers.txt b/docker_files/checksetup_answers.txt
new file mode 100755
index 0000000..da560d4
--- /dev/null
+++ b/docker_files/checksetup_answers.txt
@@ -0,0 +1,7 @@
+$answer{'ADMIN_EMAIL'} = 'admin@mozilla.bugs';
+$answer{'ADMIN_LOGIN'} = 'admin';
+$answer{'ADMIN_OK'} = 'Y';
+$answer{'ADMIN_PASSWORD'} = 'password';
+$answer{'ADMIN_REALNAME'} = 'QA Admin';
+$answer{'NO_PAUSE'} = 1;
+$answer{'urlbase'} = 'http://bmo.test/';
diff --git a/docker_files/init.pl b/docker_files/init.pl
index 6e7a892..b99451e 100755
--- a/docker_files/init.pl
+++ b/docker_files/init.pl
@@ -33,7 +33,8 @@ foreach my $key (keys %ENV) {
}
write_localconfig(\%localconfig);
-system("perl", "checksetup.pl", "--no-templates", "--no-permissions", '--no-assets');
+sleep(10);
+system("perl", "checksetup.pl", "--no-templates", "--no-permissions", '--no-assets', '/app/docker_files/checksetup_answers.txt');
my $cmd = shift @ARGV or die "usage: init.pl CMD";
my $method = "run_$cmd";
diff --git a/docker_files/tinyproxy/Dockerfile b/docker_files/tinyproxy/Dockerfile
new file mode 100644
index 0000000..bfb6f71
--- /dev/null
+++ b/docker_files/tinyproxy/Dockerfile
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+FROM alpine:3.3
+RUN apk --no-cache add tinyproxy
+COPY tinyproxy.conf /tinyproxy.conf
+EXPOSE 1080
+ENTRYPOINT ["tinyproxy"]
+CMD ["-d", "-c", "/tinyproxy.conf"]
diff --git a/docker_files/tinyproxy/tinyproxy.conf b/docker_files/tinyproxy/tinyproxy.conf
new file mode 100644
index 0000000..4e16aca
--- /dev/null
+++ b/docker_files/tinyproxy/tinyproxy.conf
@@ -0,0 +1,13 @@
+Port 1080
+Timeout 60
+DefaultErrorFile "/usr/share/tinyproxy/default.html"
+StatFile "/usr/share/tinyproxy/stats.html"
+Logfile "/var/log/tinyproxy/tinyproxy.log"
+LogLevel Info
+PidFile "/var/run/tinyproxy/tinyproxy.pid"
+MaxClients 50
+MinSpareServers 5
+MaxSpareServers 20
+StartServers 10
+MaxRequestsPerChild 1000
+ViaProxyName "tinyproxy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment