Added db:migrate and DATABASE variable

This commit is contained in:
Pavel Pivovarov
2018-12-07 22:09:26 +11:00
parent 7bf96dd47f
commit 8b53e05b06
3 changed files with 5 additions and 10 deletions

View File

@@ -25,10 +25,6 @@ docker run -d --name snibox \
snibox
```
After first run you probably will see error due to database hasn't been initialized in the attached volume. Pleas run following command to create empty database:
Default database file location is `/app/db/database/snibox.sqlite3`, however you can redefine it by using environment variable `DATABASE`.
```bash
docker exec <container_id> /app/bin/rails db:migrate
```
This will create new database instance and Snibox is ready to go.
Container is running `rake db:migrate` on every start, in order to either create database if not exist, or update database scheme if required, so backups are highly recommended.