This commit is contained in:
Evan Walsh 2019-02-01 19:37:21 -05:00
commit 7c6f96d6ba
3 changed files with 92 additions and 0 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM writeas/writefreely
COPY config.ini .
EXPOSE 8080
CMD ["bin/writefreely"]

48
README.md Normal file
View File

@ -0,0 +1,48 @@
# [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
```

37
config.ini Normal file
View File

@ -0,0 +1,37 @@
[server]
hidden_host =
port = 8080
bind = 0.0.0.0
tls_cert_path =
tls_key_path =
templates_parent_dir =
static_parent_dir =
pages_parent_dir =
keys_parent_dir =
[database]
type = sqlite3
filename = db/writefreely.db
username =
password =
database =
host = localhost
port = 3306
[app]
site_name = Write Freely
site_description =
host = http://writefreely.example.com
theme = write
disable_js = false
webfonts = true
single_user = false
open_registration = true
min_username_len = 3
max_blogs = 3
federation = true
public_stats = true
private = false
local_timeline = true
user_invites = user