Skip to content

Instantly share code, notes, and snippets.

@rosskarchner
Last active August 27, 2019 14:21
Show Gist options
  • Save rosskarchner/b001148e3bd757ac38124b3a9625d4c1 to your computer and use it in GitHub Desktop.
Save rosskarchner/b001148e3bd757ac38124b3a9625d4c1 to your computer and use it in GitHub Desktop.
FROM centos:7
RUN yum install -y centos-release-scl https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm && \
yum install -y rh-python36 rh-python36-mod_wsgi httpd24 postgresql10 && \
echo "source scl_source enable rh-python36" > /etc/profile.d/scl_python.sh && \
echo "source scl_source enable httpd24" > /etc/profile.d/scl_httpd.sh && \
source /etc/profile && \
pip3 install --no-cache-dir -U pip setuptools wheel virtualenv && yum clean all && rm -rf /var/cache/yum
ARG artifact
COPY ${artifact} /tmp/artifact.zip
ENV DJANGO_SETTINGS_MODULE=cfgov.settings.production
ENV DJANGO_STATIC_ROOT=/srv/cfgov/static
ENV ALLOWED_HOSTS='["*"]'
ENV CFGOV_PATH="/srv/cfgov"
ENV CFGOV_CURRENT="${cfgov_path}/current"
ENV STATIC_PATH="${cfgov_path}/static"
ENV APACHE_SERVER_ROOT="${cfgov_path}/current/cfgov/apache"
ENV APACHE_WWW_PATH="/var/www"
ENV CFGOV_SANDBOX="/srv/cfgov-sandbox"
ENV APACHE_PROCESS_COUNT="8"
ENV ERROR_LOG="logs/error_log"
ENV ACCESS_LOG="logs/access_log"
ENV PYTHON_VERSION="rh-python26"
RUN mkdir /srv/cfgov && scl enable rh-python36 "python /tmp/artifact.zip -d /srv/cfgov"
WORKDIR /srv/cfgov/current
RUN scl enable rh-python36 "venv/bin/django-admin collectstatic"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment