Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into datastore-dump-ui
- Loading branch information
Showing
14 changed files
with
775 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,6 @@ ckan_deb/DEBIAN/prerm | |
|
||
# node.js | ||
node_modules/ | ||
|
||
# docker | ||
contrib/docker/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,57 @@ | ||
# docker build . -t ckan && docker run -d -p 80:5000 --link db:db --link redis:redis --link solr:solr ckan | ||
|
||
# See CKAN docs on installation from Docker Compose on usage | ||
FROM debian:jessie | ||
MAINTAINER Open Knowledge | ||
|
||
ENV CKAN_HOME /usr/lib/ckan/default | ||
ENV CKAN_CONFIG /etc/ckan/default | ||
ENV CKAN_STORAGE_PATH /var/lib/ckan | ||
ENV CKAN_SITE_URL http://localhost:5000 | ||
|
||
# Install required packages | ||
RUN apt-get -q -y update && apt-get -q -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -q -y install \ | ||
# Install required system packages | ||
RUN apt-get -q -y update && apt-get -q -y upgrade && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -q -y install \ | ||
python-dev \ | ||
python-pip \ | ||
python-virtualenv \ | ||
libpq-dev \ | ||
git-core \ | ||
build-essential \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
libgeos-dev \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
postgresql-client \ | ||
build-essential \ | ||
git-core \ | ||
vim \ | ||
wget \ | ||
&& apt-get -q clean | ||
|
||
# SetUp Virtual Environment CKAN | ||
RUN mkdir -p $CKAN_HOME $CKAN_CONFIG $CKAN_STORAGE_PATH | ||
RUN virtualenv $CKAN_HOME | ||
RUN ln -s $CKAN_HOME/bin/pip /usr/local/bin/ckan-pip | ||
RUN ln -s $CKAN_HOME/bin/paster /usr/local/bin/ckan-paster | ||
# Define environment variables | ||
ENV CKAN_HOME /usr/lib/ckan | ||
ENV CKAN_VENV $CKAN_HOME/venv | ||
ENV CKAN_CONFIG /etc/ckan | ||
ENV CKAN_STORAGE_PATH=/var/lib/ckan | ||
|
||
# Build-time variables specified by docker-compose.yml / .env | ||
ARG CKAN_SITE_URL | ||
|
||
# Create ckan user | ||
RUN useradd -r -u 900 -m -c "ckan account" -d $CKAN_HOME -s /bin/false ckan | ||
|
||
# Setup virtual environment for CKAN | ||
RUN mkdir -p $CKAN_VENV $CKAN_CONFIG $CKAN_STORAGE_PATH && \ | ||
virtualenv $CKAN_VENV && \ | ||
ln -s $CKAN_VENV/bin/pip /usr/local/bin/ckan-pip &&\ | ||
ln -s $CKAN_VENV/bin/paster /usr/local/bin/ckan-paster | ||
|
||
# Setup CKAN | ||
ADD . $CKAN_VENV/src/ckan/ | ||
RUN ckan-pip install --upgrade -r $CKAN_VENV/src/ckan/requirements.txt && \ | ||
ckan-pip install -e $CKAN_VENV/src/ckan/ && \ | ||
ln -s $CKAN_VENV/src/ckan/ckan/config/who.ini $CKAN_CONFIG/who.ini && \ | ||
cp -v $CKAN_VENV/src/ckan/contrib/docker/ckan-entrypoint.sh /ckan-entrypoint.sh && \ | ||
chmod +x /ckan-entrypoint.sh && \ | ||
chown -R ckan:ckan $CKAN_HOME $CKAN_VENV $CKAN_CONFIG $CKAN_STORAGE_PATH | ||
|
||
# SetUp Requirements | ||
ADD ./requirements.txt $CKAN_HOME/src/ckan/requirements.txt | ||
RUN ckan-pip install --upgrade -r $CKAN_HOME/src/ckan/requirements.txt | ||
|
||
# TMP-BUGFIX https://github.com/ckan/ckan/issues/3388 | ||
ADD ./dev-requirements.txt $CKAN_HOME/src/ckan/dev-requirements.txt | ||
RUN ckan-pip install --upgrade -r $CKAN_HOME/src/ckan/dev-requirements.txt | ||
|
||
# TMP-BUGFIX https://github.com/ckan/ckan/issues/3594 | ||
RUN ckan-pip install --upgrade urllib3 | ||
|
||
# SetUp CKAN | ||
ADD . $CKAN_HOME/src/ckan/ | ||
RUN ckan-pip install -e $CKAN_HOME/src/ckan/ | ||
RUN ln -s $CKAN_HOME/src/ckan/ckan/config/who.ini $CKAN_CONFIG/who.ini | ||
|
||
# SetUp EntryPoint | ||
COPY ./contrib/docker/ckan-entrypoint.sh / | ||
RUN chmod +x /ckan-entrypoint.sh | ||
ENTRYPOINT ["/ckan-entrypoint.sh"] | ||
|
||
# Volumes | ||
VOLUME ["/etc/ckan/default"] | ||
VOLUME ["/var/lib/ckan"] | ||
USER ckan | ||
EXPOSE 5000 | ||
CMD ["ckan-paster","serve","/etc/ckan/default/ckan.ini"] | ||
|
||
CMD ["ckan-paster","serve","/etc/ckan/ckan.ini"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Variables in this file will be substituted into docker-compose.yml | ||
# Save a copy of this file as .env and insert your own values. | ||
# Verify correct substitution with "docker-compose config" | ||
# If variables are newly added or enabled, please delete and rebuild the images to pull in changes: | ||
# docker-compose down | ||
# docker rmi -f docker_ckan docker_db | ||
# docker rmi $(docker images -f dangling=true -q) | ||
# docker-compose build | ||
# docker-compose up -d | ||
# docker-compose restart ckan # give the db service time to initialize the db cluster on first run | ||
|
||
# Image: ckan | ||
CKAN_SITE_ID=default | ||
# | ||
# On AWS, your CKAN_SITE_URL is the output of: | ||
# curl -s http://169.254.169.254/latest/meta-data/public-hostname | ||
# CKAN_SITE_URL=http://ec2-xxx-xxx-xxx-xxx.ap-southeast-2.compute.amazonaws.com | ||
# When running locally, CKAN_SITE_URL must contain the port | ||
CKAN_SITE_URL=http://localhost:5000 | ||
# | ||
# CKAN_PORT must be available on the host: sudo netstat -na | ||
# To apply change: docker-compose down && docker rmi docker_ckan && docker-compose build ckan | ||
CKAN_PORT=5000 | ||
# | ||
# Email settings | ||
CKAN_SMTP_SERVER=smtp.corporateict.domain:25 | ||
CKAN_SMTP_STARTTLS=True | ||
CKAN_SMTP_USER=user | ||
CKAN_SMTP_PASSWORD=pass | ||
CKAN_SMTP_MAIL_FROM=ckan@localhost | ||
# | ||
# Image: db | ||
POSTGRES_PASSWORD=ckan | ||
# | ||
# POSTGRES_PORT must be available on the host: sudo netstat -na | grep 5432 | ||
# To apply change: docker-compose down && docker rmi docker_db docker_ckan && docker-compose build | ||
POSTGRES_PORT=5432 | ||
# | ||
# The datastore database will be created in the db container as docs | ||
# Readwrite user/pass will be ckan:POSTGRES_PASSWORD | ||
# Readonly user/pass will be datastore_ro:DATASTORE_READONLY_PASSWORD | ||
DATASTORE_READONLY_PASSWORD=datastore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.