Browse Source

Simplify and correct use instructions [ci skip]

pull/1677/head
Alexander Kurakin 2 years ago
parent
commit
3063d71e05
1 changed files with 18 additions and 59 deletions
  1. 77
      README.md

77
README.md

@ -28,19 +28,11 @@ You can try the [annotation demo](http://doccano.herokuapp.com).
Three options to run doccano: Three options to run doccano:
- pip(Python 3.8+)
- pip (Python 3.8+)
- Docker - Docker
- Docker Compose - Docker Compose
- production
- development
For docker and docker compose, you need to install the following dependencies:
- [Git](https://git-scm.com)
- [Docker](https://www.docker.com)
- [Docker Compose](https://docs.docker.com/compose)
### pip installation
### pip
To install doccano, simply run: To install doccano, simply run:
@ -48,6 +40,16 @@ To install doccano, simply run:
pip install doccano pip install doccano
``` ```
By default, SQLite 3 is used for the default database. If you want to use PostgreSQL, install the additional dependencies:
```bash
pip install 'doccano[postgresql]'
```
and set `DATABASE_URL` environment variable according to your PostgreSQL credentials:
```bash
DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable"
```
After installation, run the following commands: After installation, run the following commands:
```bash ```bash
@ -68,49 +70,6 @@ doccano task
Go to <http://127.0.0.1:8000/>. Go to <http://127.0.0.1:8000/>.
By default, sqlite3 is used for the default database. If you want to use PostgreSQL, install the additional dependency:
```bash
pip install 'doccano[postgresql]'
```
Create an .env file with variables in the following format, each on a new line:
```bash
POSTGRES_USER=doccano
POSTGRES_PASSWORD=doccano
POSTGRES_DB=doccano
```
Then, pass it to docker run with the --env-file flag:
```bash
docker run --rm -d \
-p 5432:5432 \
-v postgres-data:/var/lib/postgresql/data \
--env-file .env \
postgres:13.3-alpine
```
And set `DATABASE_URL` environment variable:
```bash
# Please replace each variable.
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?sslmode=disable
```
Now run the command as before:
```bash
doccano init
doccano createuser --username admin --password pass
doccano webserver --port 8000
# In another terminal.
# Don't forget to set DATABASE_URL
doccano task
```
### Docker ### Docker
As a one-time setup, create a Docker container as follows: As a one-time setup, create a Docker container as follows:
@ -130,14 +89,14 @@ Next, start doccano by running the container:
docker container start doccano docker container start doccano
``` ```
Go to <http://127.0.0.1:8000/>.
To stop the container, run `docker container stop doccano -t 5`. To stop the container, run `docker container stop doccano -t 5`.
All data created in the container will persist across restarts. All data created in the container will persist across restarts.
Go to <http://127.0.0.1:8000/>.
### Docker Compose ### Docker Compose
You need to clone the repository:
You need to install Git and to clone the repository:
```bash ```bash
git clone https://github.com/doccano/doccano.git git clone https://github.com/doccano/doccano.git
@ -150,7 +109,7 @@ _Note for Windows developers:_ Be sure to configure git to correctly handle line
git clone https://github.com/doccano/doccano.git --config core.autocrlf=input git clone https://github.com/doccano/doccano.git --config core.autocrlf=input
``` ```
Then, create an `.env` file with variables in the following format(see [./config/.env.example](https://github.com/doccano/doccano/blob/master/config/.env.example)):
Then, create an `.env` file with variables in the following format (see [./config/.env.example](https://github.com/doccano/doccano/blob/master/config/.env.example)):
```plain ```plain
# platform settings # platform settings
@ -170,7 +129,7 @@ POSTGRES_DB=doccano
#### Production #### Production
After running the following command, access <http://0.0.0.0/>.
After running the following command, access <http://127.0.0.1/>.
```bash ```bash
docker-compose -f docker-compose.prod.yml --env-file ./config/.env.example up docker-compose -f docker-compose.prod.yml --env-file ./config/.env.example up
@ -178,7 +137,7 @@ docker-compose -f docker-compose.prod.yml --env-file ./config/.env.example up
#### Development #### Development
After running the following command, access <http://127.0.0.1:3000/>. If you want to use the admin site, please access <http://127.0.0.1:8000/admin/>.
After running the following command, access <http://127.0.0.1:8000/>. If you want to use the admin site, please access <http://127.0.0.1:8000/admin/>.
```bash ```bash
docker-compose -f docker-compose.dev.yml --env-file ./config/.env.example up docker-compose -f docker-compose.dev.yml --env-file ./config/.env.example up

Loading…
Cancel
Save