Run writefreely with docker: failed selecting from collections

Hey o/

I’m trying to get Writefreely working with docker and eventually write up a small Kubernetes deployment. I’m struggling right at the start to actually create a Writefreely instance to play around with.

My commands:

docker run -v $PWD/config.ini:/go/src/app/config.ini -v $PWD/keys:/go/keys writefreely -c /go/src/app/config.ini --gen-keys 
docker run -v $PWD/config.ini:/go/src/app/config.ini -v $PWD/keys:/go/keys writefreely -c /go/src/app/config.ini

With this config:

[server]
hidden_host =
port        = 8080

[database]
type     = sqlite3
filename = user.sql

[app]
site_name         = WriteFreely Example Blog!
host              = http://localhost:8080
theme             = write
disable_js        = false
webfonts          = true
single_user       = true
open_registration = false
min_username_len  = 3
max_blogs         = 1
federation        = true
public_stats      = true
private           = false
update_checks     = true

I get this and then it exits:
ERROR: 2020/12/06 18:41:32 database.go:805: Failed selecting from collections: no such table: collections

How do i fix this error and is it possible to have writefreely create the table if one doesn’t exist already?

Hey @finn! That sounds awesome — I’d love to see a k8s deployment of WriteFreely!

What image are you using? The one through Write.as right? You should run the --config command first before the --gen-keys command. That’ll generate the database. Let me know if that works.

Also we’ve had a lot of movement going on with the Docker & WriteFreely lately. There’s a PR going on that’s fixing up the docker-compose file to make Docker deployment easier:

I am checking this out at the moment myself but I’d recommend trying it out too.

Thanks for the response! Indeed I saw the docker-compose question thankyou.

Ideally, setting up the keys and creating the database would be done with a single docker command. It would make it much easier to set up as you don’t have any dependency structure between your containers. If a container dies, then it’s trivial to bring up another one.