2016-08-12 19:09:13 +03:00
|
|
|
FROM centos:centos7
|
|
|
|
|
2016-08-16 05:41:47 +03:00
|
|
|
# need to compile swig
|
|
|
|
ENV SWIG_FEATURES="-D__x86_64__"
|
|
|
|
|
2016-09-29 20:39:38 +03:00
|
|
|
# Should change it to use ARG instead of ENV for OLYMPIA_UID
|
2016-08-16 06:47:15 +03:00
|
|
|
# once the jenkins server is upgraded to support docker >= v1.9.0
|
|
|
|
ENV OLYMPIA_UID=9500
|
2016-08-16 05:41:47 +03:00
|
|
|
RUN useradd -u ${OLYMPIA_UID} -s /sbin/nologin olympia
|
|
|
|
|
2017-02-28 16:35:30 +03:00
|
|
|
ADD docker/git.gpg.key /etc/pki/rpm-gpg/RPM-GPG-KEY-git
|
2016-08-22 22:23:17 +03:00
|
|
|
ADD docker/epel.gpg.key /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
|
2017-02-28 16:35:30 +03:00
|
|
|
|
2017-03-21 03:13:22 +03:00
|
|
|
ADD docker/epel.repo /etc/yum.repos.d/
|
2017-02-28 16:35:30 +03:00
|
|
|
ADD docker/git.repo /etc/yum.repos.d/git.repo
|
2016-08-12 19:09:13 +03:00
|
|
|
|
2016-12-13 21:12:12 +03:00
|
|
|
RUN yum install -y \
|
2016-08-12 19:09:13 +03:00
|
|
|
gcc-c++ \
|
|
|
|
gettext \
|
|
|
|
# Git, because we're using git-checkout dependencies
|
|
|
|
git \
|
|
|
|
libffi-devel \
|
|
|
|
libxml2-devel \
|
|
|
|
libxslt-devel \
|
2016-09-07 18:14:43 +03:00
|
|
|
mariadb \
|
2016-08-12 19:09:13 +03:00
|
|
|
mariadb-devel \
|
|
|
|
nodejs \
|
|
|
|
openssl-devel \
|
|
|
|
python-devel \
|
|
|
|
swig \
|
2016-08-24 19:55:06 +03:00
|
|
|
uwsgi-2.0.13.1-2.el7 \
|
2016-08-12 19:09:13 +03:00
|
|
|
uwsgi-plugin-python \
|
|
|
|
&& yum clean all \
|
2017-06-01 14:20:12 +03:00
|
|
|
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | python \
|
|
|
|
&& pip install six \
|
|
|
|
&& pip install setuptools
|
2016-08-12 19:09:13 +03:00
|
|
|
|
2016-12-13 20:22:32 +03:00
|
|
|
# Compile required locale
|
|
|
|
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
|
2017-02-01 21:06:06 +03:00
|
|
|
# version.json is overwritten by CircleCI (see circle.yml).
|
2016-12-22 23:42:41 +03:00
|
|
|
# The pipeline v2 standard requires the existence of /app/version.json
|
2017-02-01 21:06:06 +03:00
|
|
|
# inside the docker image, thus it's copied there.
|
2016-12-22 23:42:41 +03:00
|
|
|
COPY version.json /app/version.json
|
2016-08-12 19:09:13 +03:00
|
|
|
COPY . /data/olympia
|
|
|
|
WORKDIR /data/olympia
|
|
|
|
|
|
|
|
# Install all python requires
|
2016-09-28 01:09:20 +03:00
|
|
|
RUN pip install --no-cache-dir --exists-action=w --no-deps -r requirements/prod.txt \
|
|
|
|
&& [ -f requirements/prod_without_hash.txt ] \
|
|
|
|
&& pip install --no-cache-dir --exists-action=w --no-deps -r requirements/prod_without_hash.txt\
|
|
|
|
&& pip install --no-cache-dir --exists-action=w --no-deps -e .
|
2016-08-12 19:09:13 +03:00
|
|
|
|
|
|
|
RUN echo -e "from olympia.lib.settings_base import *\n\
|
|
|
|
STYLUS_BIN = 'node_modules/stylus/bin/stylus'\n\
|
|
|
|
LESS_BIN = 'node_modules/less/bin/lessc'\n\
|
2017-01-30 16:18:06 +03:00
|
|
|
CLEANCSS_BIN = 'node_modules/clean-css-cli/bin/cleancss'\n\
|
2016-08-12 19:09:13 +03:00
|
|
|
UGLIFY_BIN = 'node_modules/uglify-js/bin/uglifyjs'\n\
|
|
|
|
FXA_CONFIG = {'default': {}, 'internal': {}}\n"\
|
|
|
|
> settings_local.py
|
|
|
|
|
|
|
|
RUN DJANGO_SETTINGS_MODULE='settings_local' locale/compile-mo.sh locale
|
|
|
|
|
|
|
|
# compile asssets
|
|
|
|
RUN npm install \
|
2017-03-29 18:49:05 +03:00
|
|
|
&& DJANGO_SETTINGS_MODULE='settings_local' python manage.py compress_assets --use-uuid -t \
|
2016-08-12 19:09:13 +03:00
|
|
|
&& DJANGO_SETTINGS_MODULE='settings_local' python manage.py collectstatic --noinput
|
|
|
|
|
2016-11-01 07:35:21 +03:00
|
|
|
RUN rm -f settings_local.py settings_local.pyc
|