Skip to content

Instantly share code, notes, and snippets.

@harlowja
Created April 5, 2018 22:06
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 harlowja/74a95dd6d5ac8bcd02fb0d7c797408a6 to your computer and use it in GitHub Desktop.
Save harlowja/74a95dd6d5ac8bcd02fb0d7c797408a6 to your computer and use it in GitHub Desktop.
# NOTE: this is a template, not the actual docker file...
#
# It will be turned into a dockerfile and processed by
# jenkins and the corresponding jenkinsfile contained in
# this working directory.
FROM centos:7
MAINTAINER ${maintainers}
LABEL JENKINS_BUILD=${build_number}
LABEL JENKINS_BUILD_TAG=${build_tag}
LABEL JENKINS_BUILD_URL=${build_url}
RUN yum -y install ${epel_cent7_url}
RUN yum -y clean all
RUN yum -y install git python-devel gcc make python-pip \
python-virtualenv openssl-devel
RUN yum -y install mailcap
RUN mkdir -p /opt/ara
COPY ansible.cfg /opt/ara/ansible.cfg
COPY requirements.txt /opt/ara/requirements.txt
RUN virtualenv /opt/ara/venv
RUN source /opt/ara/venv/bin/activate && \
pip install pip --upgrade
RUN source /opt/ara/venv/bin/activate && \
pip install -r /opt/ara/requirements.txt
# Remove when https://review.openstack.org/#/c/524427/ merges...
COPY patches/Add-support-for-configuring-sqlalchemy-pool-size-tim.patch /opt/ara/venv/lib/python2.7/site-packages/
RUN cd /opt/ara/venv/lib/python2.7/site-packages/ && \
git apply Add-support-for-configuring-sqlalchemy-pool-size-tim.patch
RUN cd /opt/ara/venv/lib/python2.7/site-packages/ && \
rm Add-support-for-configuring-sqlalchemy-pool-size-tim.patch
CMD /opt/ara/venv/bin/gunicorn -w 8 \
-k gthread \
--threads 2 \
-b 0.0.0.0:80 \
--timeout 120 \
--graceful-timeout 30 \
--max-requests 25 \
-e ANSIBLE_CONFIG=/opt/ara/ansible.cfg \
ara.wsgi:application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment