diff --git a/README.md b/README.md index 9c39db94..f21591a4 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,11 @@ You can try the [annotation demo](http://doccano.herokuapp.com). Three options to run doccano: -- pip(Python 3.8+) +- pip (Python 3.8+) - Docker - 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: @@ -48,6 +40,16 @@ To install doccano, simply run: 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: ```bash @@ -68,49 +70,6 @@ doccano task Go to . -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 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 ``` +Go to . + To stop the container, run `docker container stop doccano -t 5`. All data created in the container will persist across restarts. -Go to . - ### Docker Compose -You need to clone the repository: +You need to install Git and to clone the repository: ```bash 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 ``` -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 # platform settings @@ -170,7 +129,7 @@ POSTGRES_DB=doccano #### Production -After running the following command, access . +After running the following command, access . ```bash docker-compose -f docker-compose.prod.yml --env-file ./config/.env.example up