diff --git a/CentOS-Base.repo b/CentOS-Base.repo deleted file mode 100644 index f89ff26378..0000000000 --- a/CentOS-Base.repo +++ /dev/null @@ -1,17 +0,0 @@ -[base] -name=CentOS-$releasever - Base -baseurl=http://vault.centos.org/$contentdir/$releasever/os/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -[updates] -name=CentOS-$releasever - Updates -baseurl=http://vault.centos.org/$contentdir/$releasever/updates/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -[extras] -name=CentOS-$releasever - Extras -baseurl=http://vault.centos.org/$contentdir/$releasever/extras/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 30176da5b7..2d7812a749 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,16 +24,10 @@ # Modified and simplified version of https://github.com/inspirehep/inspire-docker # to build an imagine to run in https://github.com/inspirehep/inspirehep -FROM centos:7 -# https://www.redhat.com/en/blog/centos-linux-has-reached-its-end-life-eol -# https://serverfault.com/a/1161904 -COPY CentOS-Base.repo ./etc/yum.repos.d/CentOS-Base.repo -RUN yum clean all && yum makecache - -RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum update -y --nogpgcheck && \ - yum install -y --nogpgcheck \ - ImageMagick \ +FROM fedora:40 + +RUN dnf update -y && \ + dnf install -y ImageMagick \ transfig \ file \ firefox \ @@ -45,19 +39,18 @@ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n libxml2-devel \ libxslt-devel \ mailcap \ - make \ + xrootd-client-devel \ openssl-devel \ poppler-utils \ postgresql \ postgresql-libs \ postgresql-devel \ - python-pip \ - python-devel \ - python2-xrootd \ + python2.7 \ wget \ Xvfb \ - && \ - yum clean all + xrootd \ + && dnf clean all + ENV NODE_VERSION 6.17.1 RUN mkdir /usr/local/nvm @@ -80,30 +73,33 @@ RUN npm install -g \ requirejs \ uglify-js -ENV PATH="/root/.poetry/bin:${PATH}" \ - POETRY_VIRTUALENVS_CREATE=false \ - POETRY_VERSION=1.1.14 - WORKDIR /code -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/4ec09d4e6b8ca007e67bb873c96277b54986fbdb/get-poetry.py \ - | sed -E 's/(self\._get\(self\.METADATA_URL\).decode)\(\)/\1("utf-8")/' \ - | python && \ - poetry --version && \ - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ - pip install --no-cache-dir --upgrade setuptools && \ - pip install --no-cache-dir --upgrade wheel && \ - pip install --no-cache-dir typing==3.7.4.1 +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + rm get-pip.py COPY . . -RUN poetry export --without-hashes -E all -E xrootd -f requirements.txt > requirements.poetry.txt && \ - pip install --ignore-installed --requirement requirements.poetry.txt && \ - pip install -e . +RUN python2.7 -m pip install poetry==1.1.15 && \ + python2.7 -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ + python2.7 -m pip install --no-cache-dir --upgrade setuptools && \ + python2.7 -m pip install --no-cache-dir --upgrade wheel + + + +RUN poetry config virtualenvs.create false && \ + poetry export --without-hashes -E all -E xrootd -f requirements.txt > requirements.poetry.txt + +RUN python2.7 -m pip install --ignore-installed --requirement requirements.poetry.txt && \ + python2.7 -m pip install -e . && \ + python2.7 -m pip install git+https://github.com/inspirehep/xrootd-python.git && \ + python2.7 -m pip install --requirement requirements_docker.txt + WORKDIR /usr/var/inspirehep-instance/static -RUN inspirehep npm && \ +RUN inspirehep npm && \ npm install && \ inspirehep collect -v && \ inspirehep assets build diff --git a/Dockerfile.dev b/Dockerfile.dev index a40887db2f..02d84713c8 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -24,18 +24,10 @@ # Modified and simplified version of https://github.com/inspirehep/inspire-docker # to build an imagine to run in https://github.com/inspirehep/inspirehep -FROM centos:7 -# https://www.redhat.com/en/blog/centos-linux-has-reached-its-end-life-eol -# https://serverfault.com/a/1161904 -COPY CentOS-Base.repo ./etc/yum.repos.d/CentOS-Base.repo -RUN yum clean all && yum makecache - -RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum update -y --nogpgcheck && \ - yum install -y --nogpgcheck \ - yum update -y && \ - yum install -y \ - ImageMagick \ +FROM fedora:40 + +RUN dnf update -y && \ + dnf install -y ImageMagick \ transfig \ file \ firefox \ @@ -47,19 +39,18 @@ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n libxml2-devel \ libxslt-devel \ mailcap \ - make \ + xrootd-client-devel \ openssl-devel \ poppler-utils \ postgresql \ postgresql-libs \ postgresql-devel \ - python-pip \ - python-devel \ - python2-xrootd \ + python2.7 \ wget \ Xvfb \ - && \ - yum clean all + xrootd \ + && dnf clean all + ENV NODE_VERSION 6.17.1 RUN mkdir /usr/local/nvm @@ -82,30 +73,31 @@ RUN npm install -g \ requirejs \ uglify-js -ENV PATH="/root/.poetry/bin:${PATH}" \ - POETRY_VIRTUALENVS_CREATE=false \ - POETRY_VERSION=1.1.14 - WORKDIR /code -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/4ec09d4e6b8ca007e67bb873c96277b54986fbdb/get-poetry.py \ - | sed -E 's/(self\._get\(self\.METADATA_URL\).decode)\(\)/\1("utf-8")/' \ - | python && \ - poetry --version && \ - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ - pip install --no-cache-dir --upgrade setuptools && \ - pip install --no-cache-dir --upgrade wheel && \ - pip install --no-cache-dir typing==3.7.4.1 +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + rm get-pip.py + +RUN python2.7 -m pip install poetry==1.1.15 && \ + python2.7 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ + python2.7 -m pip install --no-cache-dir --upgrade setuptools && \ + python2.7 -m pip install --no-cache-dir --upgrade wheel COPY . . -RUN poetry export --without-hashes -E all -f requirements.txt > requirements.poetry.txt && \ - pip install --ignore-installed --src /opt/python-git-modules/ --requirement requirements.poetry.txt && \ - pip install -e . +RUN poetry config virtualenvs.create false && \ + poetry export --without-hashes -E all -f requirements.txt > requirements.poetry.txt + +RUN python2.7 -m pip install --ignore-installed --src /opt/python-git-modules/ --requirement requirements.poetry.txt && \ + python2.7 -m pip install -e . && \ + python2.7 -m pip install git+https://github.com/inspirehep/xrootd-python.git && \ + python2.7 -m pip install --requirement requirements_docker.txt + WORKDIR /usr/var/inspirehep-instance/static -RUN inspirehep npm && \ +RUN inspirehep npm && \ npm install && \ inspirehep collect -v && \ inspirehep assets build diff --git a/requirements_docker.txt b/requirements_docker.txt new file mode 100644 index 0000000000..5ef38fcbce --- /dev/null +++ b/requirements_docker.txt @@ -0,0 +1,4 @@ +typing==3.7.4.1 +pathlib2==2.3.5 +six==1.14.0 +urllib3==1.24.3