Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Dec 15, 2015
2 parents 1549f3a + 0e9a12f commit 75afebf
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 131 deletions.
30 changes: 22 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
# Dockerfile for the PDC's HubDB service
#
# Base image
#
FROM mongo
# HubDB for PDC-collected aggregate data.
#
# Example:
# sudo docker pull pdcbc/hubdb
# sudo docker run -d --name hubdb -h hubdb --restart=always \
# -v ${PATH_MONGO_LIVE}:/data/db/:rw \
# -v ${PATH_MONGO_DUMP}:/data/dump/:rw \
# pdcbc/hubdb:latest
#
# Folder paths
# - Mongo live db: -v </path/>:/data/db/:rw
# - Mongo dumps: -v </path/>:/data/dump/:rw
#
FROM mongo:3.0
MAINTAINER [email protected]
ENV RELEASE 0.1.4


# Update system, install Lynx
# Packages
#
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'Dpkg::Options{ "--force-confdef"; "--force-confold" }' \
>> /etc/apt/apt.conf.d/local
RUN apt-get update; \
apt-get upgrade -y
apt-get install -y \
git; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


# Prepare /app/ folder
#
WORKDIR /app/
COPY . .
RUN git clone https://github.com/pdcbc/hubdb.git . -b ${RELEASE}
24 changes: 0 additions & 24 deletions endpoint_addPubKey.sh

This file was deleted.

25 changes: 0 additions & 25 deletions ep_sync.sh

This file was deleted.

19 changes: 10 additions & 9 deletions mongodb_init.sh → mongo_maint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ set -e -o nounset

# Run after initial boot, wait 10 seconds for mongo to start
#
sleep 5


# Create thirdnexts collection
#
mongo query_composer_development --eval 'db.createCollection("thirdnexts")'
#sleep 5


# Set db keys to prevent duplicates
Expand All @@ -25,12 +20,18 @@ mongo query_composer_development --eval \
mongo query_composer_development --eval \
'printjson( db.endpoints.ensureIndex({ base_url : 1 }, { unique : true }))'
mongo query_composer_development --eval \
'printjson( db.thirdnexts.ensureIndex({ clinic: 1, date:1 }, { unique: true }))'
'printjson( db.users.ensureIndex({ first_name: 1, last_name:1 }, { unique: true }))'


# Dump MongoDB, report failure if unsuccessful
#
mkdir -p /data/dump/
mongodump --out /data/dump/


# Import admin and user accounts
#
mongo query_composer_development --eval \
'db.users.insert({ "first_name" : "PDC", "last_name" : "Admin", "username" : "admin", "email" : "admin@pdc.io", "encrypted_password" : "\$2a\$10\$ZSuPxdODbumiMGOxtVSpRu0Rd0fQ2HhC7tMu2IobKTaAsPMmFlBD.", "agree_license" : true, "approved" : true, "admin" : true })'
'db.users.insert({ "first_name" : "PDC", "last_name" : "Admin", "username" : "admin", "email" : "admin@pdcbc.ca", "encrypted_password" : "\$2a\$10\$ZSuPxdODbumiMGOxtVSpRu0Rd0fQ2HhC7tMu2IobKTaAsPMmFlBD.", "agree_license" : true, "approved" : true, "admin" : true })'
mongo query_composer_development --eval \
'db.users.insert({ "first_name" : "PDC", "last_name" : "User", "username" : "user", "email" : "user@pdc.io", "encrypted_password" : "\$2a\$10\$ZSuPxdODbumiMGOxtVSpRu0Rd0fQ2HhC7tMu2IobKTaAsPMmFlBD.", "agree_license" : true, "approved" : true, "admin" : true })'
'db.users.insert({ "first_name" : "PDC", "last_name" : "User", "username" : "user", "email" : "user@pdcbc.ca", "encrypted_password" : "\$2a\$10\$ZSuPxdODbumiMGOxtVSpRu0Rd0fQ2HhC7tMu2IobKTaAsPMmFlBD.", "agree_license" : true, "approved" : true, "admin" : false })'
18 changes: 0 additions & 18 deletions mongodb_dump.sh

This file was deleted.

43 changes: 0 additions & 43 deletions provider_add.sh

This file was deleted.

4 changes: 0 additions & 4 deletions providers.txt

This file was deleted.

0 comments on commit 75afebf

Please sign in to comment.