summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-07-03 21:09:44 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-07 00:19:20 +0200
commite3e2c7c0273499f832ee692ca63620cd8aa8bda1 (patch)
treeeda6812f189ae6a6e682ceb30181d902a9ddc2b1 /Dockerfile
parent5eab2f4864c28ab945f92800c3294e968dd01428 (diff)
downloadbugzilla-e3e2c7c0273499f832ee692ca63620cd8aa8bda1.tar.gz
bugzilla-e3e2c7c0273499f832ee692ca63620cd8aa8bda1.tar.xz
Bug 1361439 - Create dockerflow-compliant container that runs a BMO web head
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..dd103a5db
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,49 @@
+FROM centos:6.7
+MAINTAINER Dylan William Hardison <dylan@mozilla.com>
+
+RUN yum update -y && \
+ yum install -y perl perl-core mod_perl httpd wget tar openssl mysql-libs gd git && \
+ wget -q https://s3.amazonaws.com/moz-devservices-bmocartons/bmo/vendor.tar.gz && \
+ tar -C /opt -zxvf /vendor.tar.gz bmo/local/ bmo/LIBS.txt bmo/cpanfile bmo/cpanfile.snapshot && \
+ rm /vendor.tar.gz && \
+ mkdir /opt/bmo/httpd && \
+ ln -s /usr/lib64/httpd/modules /opt/bmo/httpd/modules && \
+ mkdir /opt/bmo/httpd/conf && \
+ cp {/etc/httpd/conf,/opt/bmo/httpd}/magic && \
+ awk '{print $1}' > LIBS.txt \
+ | perl -nE 'chomp; unless (-f $_) { $missing++; say $_ } END { exit 1 if $missing }' && \
+ useradd -u 10001 -U app -m && \
+ curl -L https://cpanmin.us > /usr/local/bin/cpanm && \
+ chmod 755 /usr/local/bin/cpanm && \
+ mkdir /opt/bmo/build && \
+ rpm -qa > /tmp/rpms.list && \
+ yum install -y gcc mod_perl-devel && \
+ cpanm -l /opt/bmo/build --notest Apache2::SizeLimit && \
+ yum erase -y $(rpm -qa | diff -u - /tmp/rpms.list | sed -n '/^-[^-]/ s/^-//p') && \
+ rm -rf /opt/bmo/build/lib/perl5/{CPAN,Parse,JSON,ExtUtils} && \
+ mkdir /usr/local/share/perl5 && \
+ mv /opt/bmo/build/lib/perl5/x86_64-linux-thread-multi/ /usr/local/lib64/perl5/ && \
+ mv /opt/bmo/build/lib/perl5/Linux /usr/local/share/perl5/ && \
+ rm -vfr /opt/bmo/build && \
+ rm /tmp/rpms.list /usr/local/bin/cpanm && \
+ yum clean all -y
+
+COPY . /app
+WORKDIR /app
+RUN ln -sv /opt/bmo/local /app/local && \
+ chown -R app:app /app && \
+ cp /app/docker_files/httpd.conf /opt/bmo/httpd/ && \
+ mkdir /opt/bmo/bin && \
+ cp /app/docker_files/init.pl /opt/bmo/bin/init.pl
+
+USER app
+RUN perl checksetup.pl --no-database --default-localconfig && \
+ prove t && \
+ rm -rf /app/data && mkdir /app/data
+
+ENV PORT=8000
+
+EXPOSE $PORT
+
+ENTRYPOINT ["/opt/bmo/bin/init.pl"]
+CMD ["httpd"]