Unverified Commit f587e256 authored by Matt Pryor's avatar Matt Pryor Committed by GitHub
Browse files

Merge pull request #143 from ESGF/issue/119/django-authentication-service

Issue/119/django authentication service
parents efbbdbc7 890e4988
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -109,6 +109,13 @@ build:nginx:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/nginx
  needs: ["build:base"]

build:conda:
  extends: .docker-build
  stage: build-2
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/conda
  needs: ["build:base"]

build:search-builder:
  extends: .docker-build
  stage: build-3
@@ -130,6 +137,20 @@ build:tomcat:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/tomcat
  needs: ["build:jre"]

build:python-build:
  extends: .docker-build
  stage: build-3
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/python-build
  needs: ["build:conda"]

build:django:
  extends: .docker-build
  stage: build-3
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/django
  needs: ["build:conda"]

build:search:
  extends: .docker-build
  stage: build-4
@@ -143,3 +164,10 @@ build:thredds:
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/thredds
  needs: ["build:jdk", "build:tomcat"]

build:auth-service:
  extends: .docker-build
  stage: build-4
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/auth-service
  needs: ["build:python-build", "build:django"]
+12 −0
Original line number Diff line number Diff line
#####
## Docker image for the Django auth service
#####

ARG ESGF_REPOSITORY_BASE=esgfdeploy
ARG ESGF_IMAGES_VERSION=latest
ARG GIT_REPOSITORY=https://github.com/cedadev/django-auth-service.git
ARG GIT_VERSION=0.2.5

FROM ${ESGF_REPOSITORY_BASE}/python-build:${ESGF_IMAGES_VERSION} as python-build

FROM ${ESGF_REPOSITORY_BASE}/django:${ESGF_IMAGES_VERSION}
+14 −0
Original line number Diff line number Diff line
# Application definition

INSTALLED_APPS = [
    'django.contrib.staticfiles',
    'django.contrib.sessions',
    'authenticate',
]

ROOT_URLCONF = 'auth_service.urls'
WSGI_APPLICATION = 'auth_service.wsgi.application'

# Use a non database session engine
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_COOKIE_SECURE = False
+32 −0
Original line number Diff line number Diff line
#####
## Base image for all images that require a basic Conda installation
#####

ARG ESGF_REPOSITORY_BASE=esgfdeploy
ARG ESGF_IMAGES_VERSION=latest
FROM ${ESGF_REPOSITORY_BASE}/base:${ESGF_IMAGES_VERSION}

USER root

# Configure environment
ENV CONDA_HOME /opt/conda
ENV PATH $CONDA_HOME/bin:$PATH
# Don't buffer stdout and stderr as it breaks realtime logging
ENV PYTHONUNBUFFERED 1

# Install and configure Conda
ENV CONDA_VERSION=py37_4.8.3
RUN curl -fsSL -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-$CONDA_VERSION-Linux-x86_64.sh && \
    echo "bb2e3cedd2e78a8bb6872ab3ab5b1266a90f8c7004a22d8dc2ea5effeb6a439a *miniconda.sh" | sha256sum --check - && \
    /bin/bash miniconda.sh -f -b -p $CONDA_HOME && \
    rm miniconda.sh && \
    echo "conda ${CONDA_VERSION}" >> $CONDA_HOME/conda-meta/pinned && \
    conda config --system --prepend channels conda-forge && \
    conda config --system --set auto_update_conda false && \
    conda config --system --set show_channel_urls true && \
    conda install --quiet --yes conda && \
    conda update --all --quiet --yes && \
    conda list python | grep '^python ' | tr -s ' ' | cut -d '.' -f 1,2 | sed 's/$/.*/' >> $CONDA_HOME/conda-meta/pinned && \
    conda clean --all -f -y

USER $ESGF_UID

images/conda/README.md

0 → 100755
+10 −0
Original line number Diff line number Diff line
#####
## Image for providing a conda environment
##
## Intended for use as a base image for Python images
#####

This image provides a [Python 3.7](https://docs.python.org/3.7/) environment using
[Miniconda](https://docs.conda.io/en/latest/miniconda.html).

It is used as the base image for all Python application images.
Loading