akoeb/shoppinglist

unable to start the container

gamebeast2k opened this issue · 2 comments

The container dont start.

  1. The container need to set the environment HTTP_USER and the HTTP_PASSWORD
    {"time":"2020-12-20T14:02:26.996196036Z","level":"FATAL","prefix":"-","file":"main.go","line":"50","message":"Can not use HTTP Base Authentication with only user, needs also password"}
    Easy part. Just add -e HTTP_USER="xxx" -e HTTP_PASSWORD="xxx" to the docker run command

  2. If Issue 1 fixed the container in unable to open the database
    /go/src/github.com/akoeb/shoppinglist/main.go:69 +0xc5 {"time":"2020-12-20T13:58:20.377573426Z","level":"INFO","prefix":"-","file":"main.go","line":"55","message":"options: \"ru\"/\"ru\""} panic: unable to open database file

I use the follow command to try start the container.
docker run -d --name shoppinglist_test -e HTTP_USER="ru" -e HTTP_PASSWORD="ru" -v /docker/docker_shoppinglist/shopping.db:/data/shoppinglist.db akoeb/shoppinglist

the file /docker/docker_shoppinglist/shopping.db dont exsist on the docker host. Manually setup the file not possible. I diont know the DB shema.

Is it fixable or my fail ?
Best regards Gamebeast

akoeb commented

Hi Gamebeast,

it has been a while since I used this, but looking at the code, you won't need a database schema, it will migrate upon startup automatically.

Try the following:

  1. create an empty(!) sqlite database file: echo '.save /docker/docker_shoppinglist/shopping.db' | sqlite3 (make sure that you have write permissions to the database file path)
  2. start the docker container as you mentioned.

let me know whether that worked.

Cheers
A

sorry for the late response. But it works now. thx