Updated Setup guide (markdown)

okriuchykhin 2017-06-13 14:39:18 +02:00
parent 90a10cb769
commit 4041422f99

@ -234,14 +234,18 @@ sciNote can be integrated with an Office Online Server to enable viewing and edi
## Running inside Docker containers in production mode with docker-compose
In order to run SciNote application in production inside Docker you'll need docker engine version 1.12.0+ itself and docker-compose with version 1.6.0+.
Also you'll need to set environment variables in `production.env` file, variables are the same as described in Environmental variables section, only format of records is slightly different, use `KEY="VALUE"` record format. Only difference is DATABASE_URL=postgresql://postgres@db/scinote_production, should be set without quotes. This variable is used to configure database connection and by default it contains credentials to connect to PostgreSQL database inside `db` container, you will need to change this variable if you decide to use another DB or set password for default db user. You can generate default minimal production.env file with `make config-production`, it will generate SECRET_KEY_BASE and PAPERCLIP_HASH_SECRET as well.
Also you'll need to set environment variables in `production.env` file, variables are the same as described in [Environmental variables section](#user-content-environmental-variables), only format of records is slightly different, use `KEY="VALUE"` record format. Only difference is DATABASE_URL=postgresql://postgres@db/scinote_production, should be set without quotes. This variable is used to configure database connection and by default it contains credentials to connect to PostgreSQL database inside `db` container, you will need to change this variable if you decide to use another DB or set password for default db user.
You can generate default minimal production.env file with `make config-production`, it will generate SECRET_KEY_BASE and PAPERCLIP_HASH_SECRET as well.
After setting all required variables you need to build docker image with `make docker-production`, it will install all needed Gems and pre-compile assets.
Now, when build is finished, it is needed to initialize the database(if you do a new install). It can be done with `make database-production`. Now database is initialized and running inside `scinote_db_production` container. This container is configured to keep all DB files in the persistent Docker volume named `scinote_production_postgres`, by default it is placed in /var/lib/docker/volumes of the host system. There is also another persistent docker volume `scinote_production_files`, it is used for storing generated and uploaded files if you configure local file storage. These volumes will be kept in case you delete containers, but `docker rm` with `-v` flag will also delete volumes. Also keep in mind that `docker-compose down` with `-v` key also deletes volumes.
Background jobs worker will be running in the separate container called 'scinote_jobs_production'.
Now you can start SciNote with `docker-compose -f ./docker-compose.production.yml up`. Use `docker-compose -f ./docker-compose.production.yml up -d` to start it in the background mode. Please consult docker-compose documentation for the rest of supported commands.
So basically sequence of commands to setup SciNote is:
So basically sequence of commands to setup SciNote(for fresh install) is:
`make config-production`