Updated Setup guide (markdown)

okriuchykhin 2017-06-13 16:08:01 +02:00
parent a5a1169f7c
commit ccaf4ec0a3

@ -61,6 +61,7 @@ On Windows 10, you can use [Docker for Windows](https://docs.docker.com/docker-f
When starting sciNote application in development mode it runs in a Docker container called `scinote_web_development`, which uses volume `scinote_development_files` for storing uploaded files and `scinote_development_bundler` for storing program dependencies. The database runs in a separate container, called `scinote_db_development`. This database container makes use of a persistent volume called `scinote_development_postgres` for storing database files.
####For version prior 1.10.0
The main sciNote application runs in a Docker container called web. The database runs in a separate container, called db. This database container makes use of a special, persistent container called dbdata.
For running application in production please check this [section](#running-inside-docker-containers-in-production-mode-with-docker-compose)
@ -200,18 +201,22 @@ So basically sequence of commands to setup SciNote(for fresh install) is:
`docker-compose -f ./docker-compose.production.yml up`
### Migrating to the new production setup
If you are using some custom setup and want switch to production configuration which was introduced in version 1.10.0, it is needed to move database data from old DB to the new one running in `scinote_db_production` container.
Easiest way to do it is just to dump db from old container and restore it to the new one(after update of the application files) using your preferred db client and login credentials from your config file. You can do it inside of the web container after entering shell with `make cli` and `pg_dump` or with any GUI tool(like pgAdmin), you can find IP address of the db container with `docker inspect` and name of db container which will be in most cases `web_db_1`. But it is needed to do before updating source tree of application.
Also if you are using local file storage, you will need to move user's files from ./public/system directory in application directory to the docker volume `scinote_production_files`.
And don't forget to migrate ENV variables from `config/application.yml` to `production.env`.
After that you can update application sources and run DB migrations as described [here]()
### Upgrading SciNote installation running in production mode
First of all it is needed to rebuild docker images using new version of SciNote. Stop existing instance(if it is running).Than just run `make docker-production` in order to rebuild images.
First of all it is needed to rebuild docker images using new version of SciNote. Stop existing instance(if it is running).Then just run `make docker-production` in order to rebuild images.
Now it is needed to migrate data in database.
Open command prompt inside web container with `make cli-production` and inside it run migrations with `rake db:migrate`.
After migrations finished you can start application in normal way with `docker-compose -f ./docker-compose.production.yml up`.
On rare occasion it is needed to run additional migration scripts, please check Release Notes for that.
If you are using some custom setup and want switch to production configuration which was introduced in version 1.10.0, it is needed to move database data from old DB to the new one running in `scinote_db_production` container. Easiest way to do it is just to dump db from old container and restore it to the new one using your preferred db client and login credentials from your config file.
Also if you are using local file storage, you will need to move user's files from ./public/system directory in application directory to the docker volume `scinote_production_files`.
And don't forget to migrate env variables from `config/application.yml` to `production.env`
## Rake tasks
### Delayed jobs