-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8: MongoDB initialization also works
- Loading branch information
Showing
4 changed files
with
26 additions
and
20 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
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 |
---|---|---|
|
@@ -23,25 +23,12 @@ See also [History of Uwazi](https://github.com/huridocs/uwazi/wiki/History-of-Uw | |
The [uwazi-docker](https://github.com/fititnt/uwazi-docker) requires | ||
[docker-compose](https://docs.docker.com/compose/install/) installed. | ||
|
||
> At this moment, the Dockerfile of the uwazi is not ready, only it's external | ||
> dependencies (Elastic Search and MongoDB), so you will also need install | ||
[NVM](https://github.com/creationix/nvm) and [Yarn](https://yarnpkg.com/). | ||
|
||
Run these commands on your terminal: | ||
|
||
```bash | ||
git clone [email protected]:fititnt/uwazi-docker.git | ||
cd uwazi-docker | ||
docker-compose up -d elasticsearch mongo | ||
git clone [email protected]:huridocs/uwazi.git | ||
cd uwazi | ||
git checkout 1.1 | ||
nvm install 6.13 | ||
npm install | ||
yarn production-build | ||
yarn blank-state | ||
yarn reindex | ||
yarn run-production | ||
docker-compose run -e IS_FIRST_RUN=true uwazi | ||
``` | ||
|
||
Open your browser at <http://localhost:3000/>. User: _admin_, password: _admin_. | ||
|
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 |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#!/bin/sh | ||
|
||
echo "IS_FIRST_RUN: $IS_FIRST_RUN" | ||
DB_INITIALIZATION_PATH=/home/node/uwazi/blank_state/uwazi_development | ||
|
||
if [ "$IS_FIRST_RUN" = "true" ] ; then | ||
echo "Enviroment variable IS_FIRST_RUN is true. Assuming need to install database from blank state" | ||
# echo "Sorry, this version of uwazi-docker is not ready to initialize using docker. You need to setup first time from your host before use this container" | ||
echo "Sorry, this version of uwazi-docker is not fully ready to initialize using docker. You need to setup the MongoDB outside this container with yarn blank-state" | ||
# echo "Sorry, this version of uwazi-docker is not fully ready to initialize using docker. You need to setup the MongoDB outside this container with yarn blank-state" | ||
|
||
# mongo --version | ||
# mongorestore --version | ||
# yarn blank-state | ||
|
||
echo "\n\nDeleting ${DBHOST:-mongo} ${DATABASE_NAME:-uwazi_development} MongoDB database" | ||
|
||
mongo -host ${DBHOST:-mongo} ${DATABASE_NAME:-uwazi_development} --eval "db.dropDatabase()" | ||
|
||
echo "\n\nImporting $DB_INITIALIZATION_PATH to ${DBHOST:-mongo} ${DATABASE_NAME:-uwazi_development} MongoDB database" | ||
|
||
mongorestore -h ${DBHOST:-mongo} $DB_INITIALIZATION_PATH --db=${DATABASE_NAME:-uwazi_development} | ||
|
||
echo "Applyng yarn reindex. This will use data from MongoDB to feed Elastic Search" | ||
yarn reindex | ||
else | ||
echo "Data detected. No need to install. Running container." | ||
echo "Enviroment variable IS_FIRST_RUN is not true. Assume MongoDB and Elastic Search provide already are intialized" | ||
echo "If this is the first time and you want this container also initialize MongoDB and Elastic Search, run only ONE, and just ONE time, with variable IS_FIRST_RUN=true" | ||
fi | ||
|
||
yarn run-production |