Giter Club home page Giter Club logo

Comments (8)

karlicoss avatar karlicoss commented on August 26, 2024 6

Hey! Thanks for creating the issue!

Not yet, but it was in my plans!

from promnesia.

karlicoss avatar karlicoss commented on August 26, 2024 3

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!

from promnesia.

etopeter avatar etopeter commented on August 26, 2024 2

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:

  1. Docker shell image that mounts volume on top of src directory to have python dependencies environment and ability to edit code with favorite local editor (emacs).
  2. Docker image that installs master branch and volumes are only used to store promnesia.sqlite database.
  3. Docker image that installs python latest python module. Bonus add args during build to control version installed as well as dependencies.

In any case the merge gives us some start to build other features.

from promnesia.

infogulch avatar infogulch commented on August 26, 2024 1

I prefer:

docker-compose.yml

env_file: 
    - default.env
    - private.env
...

.gitignore

private.env

Name private.env however you like of course.

from promnesia.

koo5 avatar koo5 commented on August 26, 2024

@etopeter

Flavors that could be developed:
...
oh wow that'd be next level

from promnesia.

karlicoss avatar karlicoss commented on August 26, 2024

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"]

from promnesia.

garyng avatar garyng commented on August 26, 2024

# 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...

from promnesia.

AnweshGangula avatar AnweshGangula commented on August 26, 2024

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 promnesia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.