Podman: CouchDB
Posted on
Aku menjalankan CouchDB container pakai Podman, couchdb ini akan aku pakai untuk Plugin Obsidian LiveSync.
System Info
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ podman version
Client: Podman Engine
Version: 4.3.1
API Version: 4.3.1
Go Version: go1.19.8
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64
Siapkan working directory
$ mkdir -p ~/couchdb/data
$ cd ~/couchdb
Siapkan couchdb local config
$ nano local.ini
[couchdb]
single_node=true
max_document_size = 50000000
[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
enable_cors = true
[chttpd_auth]
require_valid_user = true
authentication_redirect = /_utils/session.html
[httpd]
WWW-Authenticate = Basic realm="couchdb"
bind_address = 0.0.0.0
enable_cors = true
[cors]
origins = app://obsidian.md,capacitor://localhost,http://localhost
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET,PUT,POST,HEAD,DELETE
max_age = 3600
Jalankan container pakai podman
$ podman run --detach --name couchdb \
-e COUCHDB_USER=your-basic-auth-user \
-e COUCHDB_PASSWORD=your-basic-auth-passwd \
-v /home/sumar/couchdb/local.ini:/opt/couchdb/etc/local.ini \
-v /home/sumar/couchdb/data:/opt/couchdb/data \
-p 192.168.1.155:5984:5984 \
couchdb:3
Generate config systemd
$ podman generate systemd --new --name couchdb > ~/.config/systemd/user/container-couchdb.service
Enable container-couchdb.service
$ systemctl --user daemon-reload
$ systemctl --user enable --now container-couchdb.service
Selesai