docker-compose-collection/obisidian-livesync/docker-compose.yml

40 lines
No EOL
1.9 KiB
YAML

---
services:
couchdb:
image: couchdb:${OBSIDIAN_COUCHDB_VERSION:-latest}
container_name: obsidian-livesync
environment:
- COUCHDB_USER=${OBSIDIAN_COUCHDB_USER:?error}
- COUCHDB_PASSWORD=${OBSIDIAN_COUCHDB_PASSWORD:?error}
volumes:
- couchdb-data:/opt/couchdb/data
- ./data/local.ini:/opt/couchdb/etc/local.ini
restart: unless-stopped
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.obsidian-livesync.entrypoints=http"
- "traefik.http.routers.obsidian-livesync.rule=Host(`${OBSIDIAN_DOMAIN:?error}`)"
- "traefik.http.middlewares.obsidian-livesync-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.obsidian-livesync.middlewares=obsidian-livesync-https-redirect"
- "traefik.http.routers.obsidian-livesync-secure.entrypoints=https"
- "traefik.http.routers.obsidian-livesync-secure.rule=Host(`${OBSIDIAN_DOMAIN:?error}`)"
- "traefik.http.routers.obsidian-livesync-secure.tls=true"
- "traefik.http.routers.obsidian-livesync-secure.service=obsidian-livesync"
- "traefik.http.services.obsidian-livesync.loadbalancer.server.port=5984"
# The part needed for CORS to work on Traefik 2.x starts here
- "traefik.http.middlewares.obsidiancors.headers.accesscontrolallowmethods=GET,PUT,POST,HEAD,DELETE"
- "traefik.http.middlewares.obsidiancors.headers.accesscontrolallowheaders=accept,authorization,content-type,origin,referer"
- "traefik.http.middlewares.obsidiancors.headers.accesscontrolalloworiginlist=app://obsidian.md,capacitor://localhost,http://localhost"
- "traefik.http.middlewares.obsidiancors.headers.accesscontrolmaxage=3600"
- "traefik.http.middlewares.obsidiancors.headers.addvaryheader=true"
- "traefik.http.middlewares.obsidiancors.headers.accessControlAllowCredentials=true"
networks:
traefik:
external: true
volumes:
couchdb-data: