mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 15:45:34 +08:00
Updated Setup guide (markdown)
parent
3f9fed92ed
commit
a5a1169f7c
1 changed files with 9 additions and 1 deletions
|
@ -57,8 +57,11 @@ On Windows 10, you can use [Docker for Windows](https://docs.docker.com/docker-f
|
|||
|
||||
### Docker structure
|
||||
|
||||
####For version 1.10.0 and later
|
||||
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
|
||||
|
||||
For running application in production please check this [section](#running-inside-docker-containers-in-production-mode-with-docker-compose)
|
||||
|
||||
### Commands
|
||||
|
@ -174,6 +177,7 @@ The following table describes all available environmental variables for sciNote
|
|||
|
||||
## Running inside Docker containers in production mode with docker-compose
|
||||
|
||||
New functionality for running in production mode was introduces in SciNote version 1.10.0.
|
||||
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](#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.
|
||||
|
@ -199,10 +203,14 @@ So basically sequence of commands to setup SciNote(for fresh install) is:
|
|||
### 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.
|
||||
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`.
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue