2014-11-20 18:48:51 +00:00
|
|
|
# vim:ft=dockerfile
|
2014-12-18 16:53:10 +00:00
|
|
|
|
2017-07-06 21:50:38 +00:00
|
|
|
FROM quay.io/quay/quay-base:latest
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2017-02-01 23:17:25 +00:00
|
|
|
WORKDIR $QUAYDIR
|
2016-05-26 21:28:57 +00:00
|
|
|
|
2017-07-11 14:34:46 +00:00
|
|
|
COPY requirements.txt requirements-tests.txt ./
|
2014-05-22 16:13:41 +00:00
|
|
|
|
2016-05-26 21:28:57 +00:00
|
|
|
# Check python dependencies for the GPL
|
|
|
|
# Due to the following bug, pip results must be piped to a file before grepping:
|
|
|
|
# https://github.com/pypa/pip/pull/3304
|
2016-06-02 16:37:02 +00:00
|
|
|
RUN cat requirements.txt | grep -v "^-e" | awk -F'==' '{print $1}' | xargs venv/bin/pip --disable-pip-version-check show > pipinfo.txt && \
|
|
|
|
test -z $(cat pipinfo.txt | grep GPL | grep -v LGPL) && \
|
2016-05-27 17:33:31 +00:00
|
|
|
rm pipinfo.txt
|
2016-05-26 21:28:57 +00:00
|
|
|
|
2017-07-11 14:34:46 +00:00
|
|
|
RUN virtualenv --distribute venv \
|
|
|
|
&& venv/bin/pip install -r requirements.txt \
|
|
|
|
&& venv/bin/pip install -r requirements-tests.txt \
|
|
|
|
&& venv/bin/pip freeze
|
2017-07-11 02:34:41 +00:00
|
|
|
|
2017-07-11 14:34:46 +00:00
|
|
|
# Install front-end dependencies
|
2017-09-27 21:14:04 +00:00
|
|
|
# JS dependencies
|
2017-08-01 17:28:24 +00:00
|
|
|
COPY yarn.lock package.json tsconfig.json webpack.config.js tslint.json ./
|
|
|
|
RUN yarn install --ignore-engines
|
2017-07-11 02:34:41 +00:00
|
|
|
|
2017-07-11 14:34:46 +00:00
|
|
|
# JS compile
|
|
|
|
COPY static static
|
|
|
|
RUN yarn build \
|
2017-08-01 17:28:24 +00:00
|
|
|
&& jpegoptim static/img/**/*.jpg \
|
|
|
|
&& optipng -clobber -quiet static/img/**/*.png
|
2017-07-11 02:34:41 +00:00
|
|
|
|
|
|
|
COPY . .
|
2015-11-20 20:03:56 +00:00
|
|
|
|
2017-09-27 21:14:04 +00:00
|
|
|
# Update local copy of AWS IP Ranges.
|
|
|
|
RUN curl https://ip-ranges.amazonaws.com/ip-ranges.json -o util/ipresolver/aws-ip-ranges.json
|
|
|
|
|
2016-06-11 00:29:45 +00:00
|
|
|
# Set up the init system
|
2017-07-06 21:50:38 +00:00
|
|
|
RUN mkdir -p /etc/my_init.d /etc/systlog-ng /usr/local/bin /etc/monit static/fonts static/ldn /usr/local/nginx/logs/ \
|
|
|
|
&& cp $QUAYCONF/init/*.sh /etc/my_init.d/ \
|
|
|
|
&& cp $QUAYCONF/init/syslog-ng.conf /etc/syslog-ng/ \
|
|
|
|
&& cp $QUAYCONF/kill-buildmanager.sh /usr/local/bin/kill-buildmanager.sh \
|
|
|
|
&& cp $QUAYCONF/monitrc /etc/monit/monitrc \
|
|
|
|
&& chmod 0600 /etc/monit/monitrc \
|
|
|
|
&& cp $QUAYCONF/init/logrotate.conf /etc/logrotate.conf \
|
|
|
|
&& cp .git/HEAD GIT_HEAD \
|
|
|
|
&& rm -rf /etc/service/syslog-forwarder
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2017-07-11 14:34:46 +00:00
|
|
|
RUN ln -s $QUAYCONF /conf
|
|
|
|
|
2017-02-23 20:34:58 +00:00
|
|
|
# Cleanup any NPM-related stuff.
|
2017-07-06 21:50:38 +00:00
|
|
|
# RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs jpegoptim optipng w3m \
|
|
|
|
# && apt-get autoremove -y \
|
|
|
|
# && apt-get clean
|
|
|
|
# && rm -rf /root/.npm /.npm /usr/local/lib/node_modules /usr/share/yarn/node_modules \
|
|
|
|
# /root/node_modules /node_modules /grunt
|
|
|
|
RUN PYTHONPATH=$QUAYPATH venv/bin/alembic heads | grep -E '^[0-9a-f]+ \(head\)$' > ALEMBIC_HEAD
|
2017-07-27 17:54:29 +00:00
|
|
|
|
2018-01-31 23:57:08 +00:00
|
|
|
RUN ./scripts/detect-config.sh
|
2018-01-31 23:56:50 +00:00
|
|
|
|
2017-07-27 17:54:29 +00:00
|
|
|
CMD ./quay-entrypoint.sh
|