Deploy WriteFreely to Dokku
Go to file
Evan Walsh 046d29e90f Add license (just in case) 2019-02-01 19:38:51 -05:00
Dockerfile Init 2019-02-01 19:37:21 -05:00
LICENSE.txt Add license (just in case) 2019-02-01 19:38:51 -05:00
README.md Init 2019-02-01 19:37:21 -05:00
config.ini Init 2019-02-01 19:37:21 -05:00

README.md

WriteFreely + Dokku

Pre-requisites

  1. You must have 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.

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