Skip to content

Instantly share code, notes, and snippets.

@ll911
Created November 7, 2018 17:17
Show Gist options
  • Select an option

  • Save ll911/e052e0bab31e938eba863bcfce9cff68 to your computer and use it in GitHub Desktop.

Select an option

Save ll911/e052e0bab31e938eba863bcfce9cff68 to your computer and use it in GitHub Desktop.
ckan-atomic-base.yaml
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: ckan-atomic-base
spec:
lookupPolicy:
local: false
tags:
- annotations: null
from:
kind: DockerImage
name: docker-registry.default.svc:5000/dbc-bcdc-tools/ckan-atomic-base
generation: null
importPolicy: {}
name: latest
referencePolicy:
type: ""
status:
dockerImageRepository: ""
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
app: ckan-atomic-base
name: ckan-atomic-base
spec:
failedBuildsHistoryLimit: 5
output:
to:
kind: ImageStreamTag
name: ckan-atomic-base:latest
source:
dockerfile: |-
FROM docker-registry.default.svc:5000/dbc-bcdc-tools/atomic-python-core
ENV APP_DIR=/app \
SRC_DIR=/app/src \
CKAN_INI=${APP_DIR}/conf/production.ini \
PIP_SRC=${SRC_DIR} \
CKAN_STORAGE_PATH=/var/lib/ckan \
GIT_URL='https://github.com/ckan/ckan.git' \
GIT_BRANCH=ckan-2.7.2 \
CKAN_SITE_URL='http://localhost:5000' \
CKAN__PLUGINS='image_view text_view recline_view datastore datapusher envvars'
WORKDIR ${APP_DIR}
RUN pip install -e git+${GIT_URL}@${GIT_BRANCH}#egg=ckan && \
cd ${SRC_DIR}/ckan && \
cp who.ini ${APP_DIR} && \
# Workaround to solve https://github.com/psycopg/psycopg2/issues/594 in Alpine 3.7
sed -i -e "s/psycopg2==2.4.5/psycopg2==2.7.3.2/g" requirements.txt && \
pip install --no-binary :all: -r requirements.txt && \
# Install CKAN envvars to support loading config from environment variables
pip install -e git+https://github.com/okfn/ckanext-envvars.git#egg=ckanext-envvars && \
# Create and update CKAN config
paster --plugin=ckan make-config ckan ${CKAN_INI} && \
paster --plugin=ckan config-tool ${CKAN_INI} "ckan.plugins = ${CKAN__PLUGINS}" && \
paster --plugin=ckan config-tool ${CKAN_INI} "ckan.site_url = ${CKAN__SITE_URL}"
type: Dockerfile
strategy:
dockerStrategy:
from:
kind: DockerImage
name: docker-registry.default.svc:5000/dbc-bcdc-tools/atomic-python-core
type: Docker
successfulBuildsHistoryLimit: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment