Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Apr 3, 2020
1 parent 941ae0a commit f6c41b3
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quickX3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quickX3/
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM python:2.7-buster
LABEL maintainer="Emerson Rocha <rocha@ieee.org>"

# @see https://hub.docker.com/_/python
# @see https://github.com/docker-library/docs/tree/master/python#how-to-use-this-image
# @see https://github.com/HXLStandard/hxl-proxy/blob/master/Dockerfile

# File initialy based on # @see https://github.com/fititnt/uwazi-docker/blob/master/Dockerfile

## Install common software
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
bzip2 \
dh-autoreconf \
git

# ## Download Uwazi v1.4
# RUN git clone -b v1.4 --single-branch --depth=1 https://github.com/huridocs/uwazi.git /home/node/uwazi/ \
# && chown node:node -R /home/node/uwazi/ \
# && cd /home/node/uwazi/ \
# && yarn install \
# && yarn production-build

RUN git clone -b master --single-branch --depth=1 https://github.com/SimonbJohnson/quickX3.git /usr/src/app/
# RUN git clone -b master --single-branch --depth=1 https://github.com/SimonbJohnson/quickX3.git /usr/src/app/ \
# && chown node:node -R /home/node/uwazi/ \
# && cd /home/node/uwazi/ \
# && yarn install \
# && yarn production-build

WORKDIR /usr/src/app/
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

#COPY --chown=node:node docker-entrypoint.sh /docker-entrypoint.sh
COPY docker-entrypoint.sh /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# hxldash-docker
[draft] Unofficial dockerized version of HXLdash ("Create data visualisations quickly by leveraging the HXL - Humanitarian eXchange Language") for local development. The hosted version (maintained by British Red Cross) is at https://hxldash.com/

## Usage

```bash
docker build -t hxldash .
docker run -it --rm --name hxldash-app hxldash
```
174 changes: 174 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# From https://github.com/fititnt/uwazi-docker/blob/master/docker-compose.yml

version: "3"

services:
uwazi:
build: ./
working_dir: /home/node/uwazi
ports:
- 3000:3000
environment:
- DBHOST=mongo
- DATABASE_NAME=uwazi_development
- ELASTICSEARCH_URL=http://elasticsearch:9200
- UPLOADS_FOLDER=/data/uploaded_documents
# - LOGS_DIR=/path/to/log
- IS_FIRST_RUN=${IS_FIRST_RUN:-false}
volumes:
- uploaded_documents:/data/uploaded_documents
depends_on:
- elasticsearch
- mongo

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.3
restart: unless-stopped
command: elasticsearch -Expack.security.enabled=false -Ecluster.name=docker-cluster -Ehttp.port=9200 -Ehttp.cors.allow-origin="http://localhost:51000" -Ehttp.cors.enabled=true -Ehttp.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization -Ehttp.cors.allow-credentials=true
environment:
- cluster.name=docker-cluster
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch_data1:/usr/share/elasticsearch/data
# Close these ports. No unprotected elasticsearch should be published.
# ports:
# - 9200:9200

# dejavu "The Missing Web UI for Elasticsearch"
# See https://github.com/appbaseio/dejavu
# To configure, access http://localhost:51000 and use:
# http://localhost:9200
# uwazi_development
elasticsearch-gui-dejavu:
image: appbaseio/dejavu:latest
ports:
#- "1358:1358"
- "51000:1358"
depends_on:
- elasticsearch

mongo:
image: mongo:3.4
restart: unless-stopped
volumes:
# - ./data/mongo:/data/db
- mongodb_data1:/data/db
command: mongod --smallfiles
# Don't publish unprotected mongod
# ports:
# - 27017:27017
logging:
options:
max-size: 10m
max-file: '3'

# Cross-platform and self hosted, easy to use mongodb management tool - Formerly Mongoclient
# See https://github.com/nosqlclient/nosqlclient
mongo-gui-mongoclient:
image: mongoclient/mongoclient:latest
volumes:
- ./data/mongo:/data/db
environment:
- MONGO_URL=mongodb://mongo:27017
depends_on:
- mongo
ports:
- 52000:3000

volumes:
uploaded_documents:
driver: local
mongodb_data1:
driver: local
elasticsearch_data1:
driver: local
services:
uwazi:
build: ./
working_dir: /home/node/uwazi
ports:
- 3000:3000
environment:
- DBHOST=mongo
- DATABASE_NAME=uwazi_development
- ELASTICSEARCH_URL=http://elasticsearch:9200
- UPLOADS_FOLDER=/data/uploaded_documents
# - LOGS_DIR=/path/to/log
- IS_FIRST_RUN=${IS_FIRST_RUN:-false}
volumes:
- uploaded_documents:/data/uploaded_documents
depends_on:
- elasticsearch
- mongo

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.3
restart: unless-stopped
command: elasticsearch -Expack.security.enabled=false -Ecluster.name=docker-cluster -Ehttp.port=9200 -Ehttp.cors.allow-origin="http://localhost:51000" -Ehttp.cors.enabled=true -Ehttp.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization -Ehttp.cors.allow-credentials=true
environment:
- cluster.name=docker-cluster
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch_data1:/usr/share/elasticsearch/data
# Close these ports. No unprotected elasticsearch should be published.
# ports:
# - 9200:9200

# dejavu "The Missing Web UI for Elasticsearch"
# See https://github.com/appbaseio/dejavu
# To configure, access http://localhost:51000 and use:
# http://localhost:9200
# uwazi_development
elasticsearch-gui-dejavu:
image: appbaseio/dejavu:latest
ports:
#- "1358:1358"
- "51000:1358"
depends_on:
- elasticsearch

mongo:
image: mongo:3.4
restart: unless-stopped
volumes:
# - ./data/mongo:/data/db
- mongodb_data1:/data/db
command: mongod --smallfiles
# Don't publish unprotected mongod
# ports:
# - 27017:27017
logging:
options:
max-size: 10m
max-file: '3'

# Cross-platform and self hosted, easy to use mongodb management tool - Formerly Mongoclient
# See https://github.com/nosqlclient/nosqlclient
mongo-gui-mongoclient:
image: mongoclient/mongoclient:latest
volumes:
- ./data/mongo:/data/db
environment:
- MONGO_URL=mongodb://mongo:27017
depends_on:
- mongo
ports:
- 52000:3000

volumes:
uploaded_documents:
driver: local
mongodb_data1:
driver: local
elasticsearch_data1:
driver: local
10 changes: 10 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

whoami

python --version

pwd

ls -lha /usr/src/app/

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
django
psycopg2
django-cookie-law

0 comments on commit f6c41b3

Please sign in to comment.