zuul-preview/Dockerfile
James E. Blair 26d88125ef Handle SSL proxying and other fixes
Enable mod_ssl and enable proxying to ssl-terminated endpoints.

In the case where the artifact is not found, return NULL instead
of the bogus "Artifact_not_found" url, otherwise we can end up in
a loop where we continuously append that to the url.

Strip trailing slashes from the returned proxy target.  We can't
guarantee that folks won't have a '/' at the end of the artifact
url they return to Zuul (and in fact, it's probably more correct
that they do).  But our regex in mod_rewrite guarantees that we
will add a slash to it.  One sure way to handle this is just to
strip it from the data returned from Zuul if present.

Add a .dockerignore file with both itself and the Dockerfile
added, so that docker won't rebuild extra layers (like the C++
compile layer) if we just change the Dockerfile.

Change-Id: I00dfd0b6842abedf938702a816698d1c6526974d
2020-04-08 09:50:29 -07:00

45 lines
1.5 KiB
Docker

# Copyright (C) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
FROM debian:testing-slim as builder
RUN mkdir -p /output/bindep
RUN apt-get update && apt-get install -y python3-pip git && pip3 install bindep
COPY bindep.txt /bindep.txt
RUN cd / && bindep -l newline > /output/bindep/run.txt
RUN apt-get install -y $(bindep -b compile)
COPY . /src
RUN cd /src \
&& autoreconf -fi \
&& ./configure --with-comment=$(git describe --always) \
&& make \
&& make install
FROM debian:testing-slim
COPY --from=builder /output/bindep/run.txt /run.txt
RUN apt-get update \
&& apt-get install -y dumb-init apache2 $(cat /run.txt) \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /run.txt \
&& a2enmod rewrite proxy proxy_http ssl
COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf
COPY --from=builder /usr/local /usr/local
EXPOSE 80
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
ENV ZUUL_API_URL=
CMD ["/usr/sbin/apachectl", "-DFOREGROUND", "-e", "info"]