services: nowledge-mem-snap: image: czyt/nowledge-mem-snap:latest container_name: nowledge-mem-snap restart: unless-stopped env_file: - example.env ports: - "14335:14335" volumes: # Default: Docker named volume. - snap-data:/app/data # Alternative: host-path bind mount. `./snap-data` is relative to this docker-compose.yml file. # - type: bind # source: ./snap-data # target: /app/data # Optional operator-level directory snapshot sources for the official Nowledge Mem Docker layout. # Official Nowledge Mem compose stores irreplaceable data in `./data` and valuable config in `./config`. # `./cache` is rebuildable cache, so it is not mounted here by default. # If this compose file is not next to those directories, replace `source` with absolute host paths. # # Short bind syntax: # - ./data:/mem-data:ro # - ./config:/mem-config:ro # # Equivalent long bind syntax: # - type: bind # source: ./data # target: /mem-data # read_only: true # - type: bind # source: ./config # target: /mem-config # read_only: true # # After mounting directory sources, enable them in example.env: # NMEM_SNAP_ALLOWED_SOURCE_ROOTS=mem-data=/mem-data,mem-config=/mem-config # Format: root-key=/container/path. The path must match the mount target above. healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:14335/healthz"] interval: 30s timeout: 3s start_period: 5s retries: 3 # Default database: # - The app uses SQLite by default. # - Keep `NMEM_SNAP_DATABASE_TYPE=sqlite` and `NMEM_SNAP_DATABASE_DSN=` in example.env. # - With the default named volume, SQLite data is stored at /app/data/data.db inside the container. # - If you switch to the bind mount above, it is stored under `./snap-data/data.db` on the host. # # Optional PostgreSQL example: # 1. Uncomment this service and the `snap-postgres` volume below. # 2. In example.env, set: # NMEM_SNAP_DATABASE_TYPE=postgres # NMEM_SNAP_DATABASE_DSN=postgres://nowledge_mem_snap:nowledge_mem_snap_password@postgres:5432/nowledge_mem_snap?sslmode=disable # 3. Run `docker compose up -d`. # # postgres: # image: postgres:16-alpine # container_name: nowledge-mem-snap-postgres # restart: unless-stopped # environment: # POSTGRES_DB: nowledge_mem_snap # POSTGRES_USER: nowledge_mem_snap # POSTGRES_PASSWORD: nowledge_mem_snap_password # healthcheck: # test: ["CMD-SHELL", "pg_isready -U nowledge_mem_snap -d nowledge_mem_snap"] # interval: 10s # timeout: 5s # retries: 5 # volumes: # # Default: Docker named volume. # - snap-postgres:/var/lib/postgresql/data # # Alternative: host-path bind mount. # # - type: bind # # source: ./postgres-data # # target: /var/lib/postgresql/data # # Optional MySQL/MariaDB example: # 1. Uncomment this service and the `snap-mysql` volume below. # 2. In example.env, set: # NMEM_SNAP_DATABASE_TYPE=mysql # NMEM_SNAP_DATABASE_DSN=nowledge_mem_snap:nowledge_mem_snap_password@tcp(mysql:3306)/nowledge_mem_snap?parseTime=true&charset=utf8mb4&loc=Local # 3. Run `docker compose up -d`. # # mysql: # image: mysql:8.4 # container_name: nowledge-mem-snap-mysql # restart: unless-stopped # environment: # MYSQL_DATABASE: nowledge_mem_snap # MYSQL_USER: nowledge_mem_snap # MYSQL_PASSWORD: nowledge_mem_snap_password # MYSQL_ROOT_PASSWORD: nowledge_mem_snap_root_password # healthcheck: # test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-unowledge_mem_snap", "-pnowledge_mem_snap_password"] # interval: 10s # timeout: 5s # retries: 10 # volumes: # # Default: Docker named volume. # - snap-mysql:/var/lib/mysql # # Alternative: host-path bind mount. # # - type: bind # # source: ./mysql-data # # target: /var/lib/mysql volumes: snap-data: # Uncomment with the optional PostgreSQL service when using the default named volume. # snap-postgres: # Uncomment with the optional MySQL service when using the default named volume. # snap-mysql: