writefreely-dokku/README.md

49 lines
1.6 KiB
Markdown

# [WriteFreely](https://writefreely.org/) + [Dokku](http://dokku.viewdocs.io/dokku/)
## Pre-requisites
1. You must have [Dokku](http://dokku.viewdocs.io/dokku/) installed on your server already for these steps to work.
2. You must download the files contained in this repo (`Dockerfile` and `config.ini`) and have them in a folder on your local computer.
3. You must edit the [config.ini you downloaded to match the settings you'd like](https://github.com/writefreely/documentation/blob/master/admin/config.md).
## Installation
First, connect to your server via SSH and create the `writefreely` app.
```
dokku apps:create writefreely
```
Then, setup the directories for WriteFreely's data so it won't be wiped each time you re-deploy.
```
mkdir -p /var/lib/dokku/data/storage/writefreely/{db,keys}
chown daemon:daemon /var/lib/dokku/data/storage/writefreely/*
dokku storage:mount writefreely /var/lib/dokku/data/storage/writefreely/keys:/go/keys
dokku storage:mount writefreely /var/lib/dokku/data/storage/writefreely/db:/go/db
dokku proxy:ports-set writefreely http:80:8080
```
Next, open the folder the files you downloaded from this repo are in. Initialize a git repo in it.
```
git init
git add --all
git commit -m "Init"
git remote add dokku dokku@[YOUR SERVER'S IP OR URL]:writefreely
git push dokku master
```
This deploy will fail. You can then initialize WriteFreely's database and keys.
```
dokku run writefreely bin/writefreely --init-db
dokku run writefreely bin/writefreely --gen-keys
```
Finally, you can rebuild the app and it'll run as expected.
```
dokku ps:rebuild writefreely
```