Commit 74565dd8 authored by tsukumi's avatar tsukumi

Change: update README.md

parent dee32088
...@@ -25,7 +25,7 @@ CORS_ALLOW=http://localhost:9000 ...@@ -25,7 +25,7 @@ CORS_ALLOW=http://localhost:9000
GUEST_SESSIONS=10 GUEST_SESSIONS=10
# MongoDB Connection # MongoDB Connection
MONGO_HOST=mongo MONGO_HOST=localhost
MONGO_PORT=27017 MONGO_PORT=27017
MONGO_DB=tester MONGO_DB=tester
MONGO_USERNAME=root MONGO_USERNAME=root
......
### Docker
Follow the quickstart instructions in our docker repo's [README](https://github.com/shadowban-eu/docker#shadowbandev). # Twitter ShadowBan Test (Backend)
### Install/Run Frontend:
[tsukumijima/shadowban-eu-frontend](https://github.com/tsukumijima/shadowban-eu-frontend)
Backend (this repository):
[tsukumijima/shadowban-eu-backend](https://github.com/tsukumijima/shadowban-eu-backend)
## Setup
Run the following commands in order.
```bash
# Clone this repository
$ git@github.com:tsukumijima/shadowban-eu-frontend.git
$ cd shadowban-eu-backend
# Dependencies installation
$ pip install --no-cache-dir -r requirements.txt
# Copy .env.example to .env
$ cp .env.example .env
```
Run the api server with the following command.
By default, the API server is listening on port 9001.
```bash ```bash
$ git clone https://github.com/shadowban-eu/testing ./testing; cd $_ # Specify the name of the .env file as an argument
$ ./bin/install.sh $ ./docker-entry.sh .env
$ ./bin/docker-entry.sh .env.example # takes any .env file
``` ```
### Memory Profiling ## Setup with Docker
Using [memory-profiler](https://pypi.org/project/memory-profiler/) to debug memory usage:
Run the following commands in order.
```bash
# Clone this repository
$ git@github.com:tsukumijima/shadowban-eu-frontend.git
$ cd shadowban-eu-backend
# Copy .env.example to .env
$ cp .env.example .env
```
If you use Docker, you need to change `MONGO_HOST` in .env from `localhost` to `mongo` .
Please edit the .env file in an editor.
Run the api server with the following command.
By default, the API server is listening on port 9001.
```bash ```bash
# When env vars are already set # The first time you run it, the container will be created automatically
$ ./bin/docker-entry.sh mprof $ docker-compose up -d
# Otherwise, read from file
$ ./bin/docker-entry.sh .env.example mprof
# Passes remaining arguments to mprof (set interval to 5s)
$ ./bin/docker-entry.sh .env.example mprof -T 5
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment