forked from uishon/Sefaria-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* README.md updated. local_settings.py changed. docker-compose.cloud.yml added for deploy * add to deploy * add dump_small.tar.gz to gitignore * README.md update - for copy the local_settings file to the machine.
- Loading branch information
Showing
4 changed files
with
53 additions
and
7 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Sefaria-Project | ||
dump | ||
/dump_small.tar.gz |
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,15 +1,38 @@ | ||
# Sefaria-Docker | ||
These scripts create three containers tied together with docker-compose. One is a vanilla Redis install, one is a mongo install built with the latest Sefaria data, and the third is a Python/Django/Node server running the latest Sefaria code. | ||
These scripts create three containers tied together with docker-compose. | ||
One is a vanilla Redis install, one is a mongo install built with the latest Sefaria data, | ||
and the third is a Python/Django/Node server running the latest Sefaria web code. | ||
|
||
The `./build` script will fetch the latest data and built the containers. | ||
The `./build` script will fetch the latest data and built the containers. | ||
The `./run` script will bring up the containers and provision the local Sefaria web client on `0.0.0.0:8000`. | ||
|
||
|
||
# Quick Start | ||
* Install Docker. | ||
* On Mac, this works well - https://store.docker.com/editions/community/docker-ce-desktop-mac | ||
* Clone this repo. | ||
* `./build` | ||
* `./run` | ||
* Browse to `http://0.0.0.0:8000`. | ||
* Download https://storage.googleapis.com/sefaria-mongo-backup/dump_small.tar.gz to local directory. | ||
* `./build`. | ||
* `./run`. | ||
* Browse to `http://0.0.0.0:8000` / `localhost:8000`. | ||
* To check the containers status and ports type - `docker ps`. | ||
|
||
# API | ||
* To fetch data from the Sefaria API browse `localhost:8000/api/`. | ||
* An example `localhost:8000/api/texts/Berakhot.2a?commentary=1` | ||
will get you the text and all the commentary of "Berakhot" book, page 2, sub-page "b". | ||
* For more examples import `sefaria api.postman_collection.json` to Postman. | ||
|
||
# Upload Images to AWS ECR | ||
* Run: | ||
```bash | ||
./aws_push.sh | ||
``` | ||
|
||
# Run Containers in AWS EC2 | ||
* Copy `docker-compose.cloud.yml` and `local_settings.py` to the EC2 machine. | ||
* `local_settings.py` - allow access from any host. | ||
* Run in EC2 machine: | ||
```bash | ||
docker.compose -f docker-compose.cloud.yml up -d | ||
``` | ||
|
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,22 @@ | ||
version: '3' | ||
|
||
services: | ||
mongo: | ||
restart: always | ||
image: 058331968334.dkr.ecr.eu-central-1.amazonaws.com/shitufta-sefaria-db | ||
ports: | ||
- "27017:27017" | ||
redis: | ||
restart: always | ||
image: redis | ||
web: | ||
restart: always | ||
image: 058331968334.dkr.ecr.eu-central-1.amazonaws.com/shitufta-sefaria-api | ||
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" | ||
volumes: | ||
- "$PWD/local_settings.py:/www/sefaria/local_settings.py" # allow access from any host | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- mongo | ||
- redis |
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