Skip to content

Commit

Permalink
wip: updates for 7.6.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Oct 4, 2024
1 parent d92b270 commit 0b9d7ec
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
49 changes: 20 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04 as base
FROM ubuntu:24.04 as base
USER root

## Setting default environment variables
Expand Down Expand Up @@ -26,29 +26,26 @@ RUN set -ex \
docbook-mathml \
libgdal-dev \
libpq-dev \
python3.10 \
python3.10-dev \
python3.12 \
python3.12-dev \
curl \
python3.10-distutils \
libldap2-dev libsasl2-dev ldap-utils \
dos2unix \
" \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends $BUILD_DEPS \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python3.10 get-pip.py
&& apt-get install -y --no-install-recommends $BUILD_DEPS

RUN pip3 wheel --no-cache-dir -r ${WHEELS}/requirements.txt \
&& pip3 wheel --no-cache-dir -r ${WHEELS}/requirements_dev.txt \
&& pip3 wheel --no-cache-dir gunicorn \
&& pip3 wheel --no-cache-dir django-auth-ldap
RUN apt-get install -y python3-pip

RUN pip wheel --no-cache-dir gunicorn \
&& pip wheel --no-cache-dir django-auth-ldap

# Add Docker-related files
COPY docker/entrypoint.sh ${WHEELS}/entrypoint.sh
RUN chmod -R 700 ${WHEELS} &&\
dos2unix ${WHEELS}/*.sh

FROM base
FROM base

# Get the pre-built python wheels from the build environment
RUN mkdir ${WEB_ROOT}
Expand All @@ -62,50 +59,44 @@ COPY --from=wheelbuilder ${WHEELS} /wheels
# a minimised build of GDAL could remove several hundred MB from the container layer.
RUN set -ex \
&& RUN_DEPS=" \
mime-support \
libgdal-dev \
python3-venv \
postgresql-client-12 \
python3.10 \
python3.10-distutils \
python3.10-venv \
python3.12 \
python3-pip \
python3.12-venv \
" \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=18 \
&& NODE_MAJOR=20 \
&& (echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list) \
&& curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends $RUN_DEPS \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python3.10 get-pip.py \
&& apt-get -y install --no-install-recommends nodejs
&& apt-get install -y nodejs

# Install Yarn components
COPY ./package.json ${ARCHES_ROOT}/arches/install/package.json
WORKDIR ${ARCHES_ROOT}/arches/install
# Install npm components
COPY ./package.json ${ARCHES_ROOT}/package.json
WORKDIR ${ARCHES_ROOT}
RUN mkdir -p ${ARCHES_ROOT}/node_modules
RUN apt-get install -y git
RUN npm install

## Install virtualenv
WORKDIR ${WEB_ROOT}

RUN mv ${WHEELS}/entrypoint.sh entrypoint.sh

RUN python3.10 -m venv ENV \
RUN python3.12 -m venv ENV \
&& . ENV/bin/activate \
&& pip install wheel setuptools requests \
&& pip install rjsmin==1.2.0 MarkupSafe==2.0.0 \
&& pip install requests \
&& pip install -f ${WHEELS} django-auth-ldap \
&& pip install -f ${WHEELS} gunicorn \
&& pip install --only-binary :all: -r ${WHEELS}/requirements.txt \
-f ${WHEELS} \
&& pip install -r ${WHEELS}/requirements_dev.txt \
-f ${WHEELS} \
&& rm -rf ${WHEELS} \
&& rm -rf /root/.cache/pip/*

Expand All @@ -117,7 +108,7 @@ COPY . ${ARCHES_ROOT}
WORKDIR ${ARCHES_ROOT}

RUN . ../ENV/bin/activate \
&& pip install -e '.[dev]' --no-binary :all:
&& pip install -e '.[dev]' --prefer-binary

# Set default workdir
WORKDIR ${ARCHES_ROOT}
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ dependencies = [
"openpyxl==3.1.2",
"pillow>=7.0.0",
"polib==1.1.1",
"psycopg2==2.9.9",
"psycopg2-binary==2.9.9",
"pycryptodome<4.0.0,>=3.3.1",
"pyjwt>=2.0.0,<3",
"pyjwt[crypto]",
"PyLD[requests]==1.0.5",
"PyLD[requests]==2.0.4",
"pyotp>=2.6.0",
"pyprind==2.11.3",
"pyshp==2.1.2",
"pyshp==2.2.0",
"python-memcached==1.59",
"python-slugify==7.0.0",
"pytz==2023.3",
Expand Down Expand Up @@ -112,4 +112,4 @@ exclude = '''
| build
| dist
)/
'''
'''

0 comments on commit 0b9d7ec

Please sign in to comment.