Open garyng opened 4 years ago
Hey! Thanks for creating the issue!
Not yet, but it was in my plans!
Thanks for merging this feature. I call it initial commit because it could and should be extended.
Current feature allows build for "local" testing/running.
To further streamline docker as viable deployment method I would like to have a lightweight image available in DockerHub.
I'm proposing creating docker/alpine/Dockerfile
and have that automatically build tags.
There is one more improvement that could be made and that is python dependencies. Right now Dockerfile has hardcoded pip install ...
instead it could be using setup.py
from the root repo.
Flavors that could be developed:
In any case the merge gives us some start to build other features.
BTW, I played a bit more with docker and docker-compose lately, and managed to pack in most of Promnesia along with dependencies.. I'll share it soon-ish!
@etopeter
Flavors that could be developed: ... oh wow that'd be next level
Snippet from my personal compose file, ideally I'd like the one some thing like this
version: "3.7"
# define volume mappings (so it's possible to reuse them later)
x-cache: &cache
{ source: /tmp/promnesia-cache,
target: /tmp/promnesia-cache,
type: bind }
# keep paths mapping as intact as possible; makes it simpler to setup & debug
x-backups: &backups
{ source: /path/to/backups,
target: /path/to/backups,
type: bind, read_only: True }
# .... other volumes
# define as much as possible here to avoid duplication
x-promnesia-base: &promnesia-base
build: { dockerfile: promnesia.Dockerfile, context: . }
user: '1000:1000'
volumes: [*setup, *promnesia-env,
*hpi-cfg,
*cache,
*backups, *polar,
*logs, *notes, *zim,
{ source: /code/promnesia,
target: /code/promnesia,
type: bind, read_only: True },
]
services:
promnesia_setup:
<<: *promnesia-base
entrypoint: /code/promnesia/docker-setup.sh
promnesia_index:
<<: *promnesia-base
environment:
- PROMNESIA_CORES=8
- PROMNESIA_FD_EXTRA_ARGS=--ignore-file /code/promnesia/ignored
entrypoint: /code/promnesia/scripts/promnesia index
promnesia_index_quick:
<<: *promnesia-base
environment:
# I fucking hate yaml, can't reuse parts of arrays...
- PROMNESIA_CORES=8
- PROMNESIA_FD_EXTRA_ARGS=--ignore-file /code/promnesia/ignored
- PROMNESIA_INDEX_POLICY=update
entrypoint: /code/promnesia/scripts/promnesia index --config /.config/promnesia/quick_config.py
promnesia_serve:
<<: *promnesia-base
restart: unless-stopped
entrypoint: /code/promnesia/scripts/promnesia serve
ports: ["13131:13131"]
# I fucking hate yaml, can't reuse parts of arrays...
I agree!
Normally what I did for environment variables is to create a shared .env
file, and put the service-specific overrides into <service>.env
file. Then include them with env_file
(https://docs.docker.com/compose/compose-file/#env_file):
env_file:
- .env
- <service>.env
It does require you to checkin your .env
file though...
I prefer:
docker-compose.yml
env_file:
- default.env
- private.env
...
.gitignore
private.env
Name private.env
however you like of course.
Are there instructions anywhere on how to build the docker container and how to use it with my local knowledge base (either obsidian, logseq etc...)?
Can Docker refer to my notes which are outside the container?
From hackernews!
Is there a docker image for running the backend?