{"id":422,"date":"2022-03-10T08:58:39","date_gmt":"2022-03-10T14:58:39","guid":{"rendered":"https:\/\/www.scottharvanek.com\/?p=422"},"modified":"2022-03-10T08:58:39","modified_gmt":"2022-03-10T14:58:39","slug":"wiki-js-docker-compose-w-postgres-persistent-storage-via-nfs-and-traefik","status":"publish","type":"post","link":"https:\/\/www.scottharvanek.com\/?p=422","title":{"rendered":"Wiki.JS docker-compose w\/ postgres persistent storage via NFS and Traefik"},"content":{"rendered":"\n<p>Here&#8217;s an example of our docker-file for <a href=\"https:\/\/js.wiki\" data-type=\"URL\" data-id=\"https:\/\/js.wiki\">Wiki.JS<\/a> with NFS DB storage, Postgres and <a href=\"https:\/\/traefik.io\" data-type=\"URL\" data-id=\"https:\/\/traefik.io\">Traefik<\/a>;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">version: \"3\"\nvolumes:\n  db-data:\n      driver_opts:\n        type: \"nfs\"\n        o: addr=nfshost.example.com,nolock,soft,rw\n        device: \":\/mnt\/Pool0\/WikiJS\"\nservices:\n  db:\n    image: postgres:11-alpine\n    environment:\n      POSTGRES_DB: wiki\n      POSTGRES_PASSWORD: Supersecurepassword\n      POSTGRES_USER: wikijs\n    command: postgres -c listen_addresses='*'\n    logging:\n      driver: \"none\"\n    restart: unless-stopped\n    networks:\n      - internal\n    labels:\n     - traefik.enable=false\n    volumes:\n      - type: volume\n        source: db-data\n        target: \/var\/lib\/postgresql\/data\n        volume:\n            nocopy: true\n\n\n  wiki:\n    image: ghcr.io\/requarks\/wiki:2\n    depends_on:\n      - db\n    environment:\n      DB_TYPE: postgres\n      DB_HOST: db\n      DB_PORT: 5432\n      DB_USER: wikijs\n      DB_PASS: Supersecurepassword\n      DB_NAME: wiki\n    restart: unless-stopped\n    networks:\n      - proxy\n      - internal\n    labels:\n      - \"traefik.enable=true\"\n      - \"traefik.docker.network=proxy\"\n      - \"traefik.http.routers.ex-wikijs.entrypoints=https\"\n      - \"traefik.http.routers.ex-wikijs.rule=Host(`wikijs.example.com`)\"\n      - \"traefik.http.services.ex-wikijs.loadbalancer.server.port=3000\"\n\nnetworks:\n  proxy:\n    external: true\n  internal:\n    external: false\n<\/pre>\n\n\n\n<p>This stands up a postgres instance using the NFS mount as storage, allows the internal network to connect to it, stands up a wiki.js instance and gets it all going for you.  All behind a Traefik proxy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s an example of our docker-file for Wiki.JS with NFS DB storage, Postgres and Traefik; version: &#8220;3&#8221; volumes: db-data: driver_opts: type: &#8220;nfs&#8221; o: addr=nfshost.example.com,nolock,soft,rw device: &#8220;:\/mnt\/Pool0\/WikiJS&#8221; services: db: image: postgres:11-alpine environment: POSTGRES_DB: wiki POSTGRES_PASSWORD: Supersecurepassword POSTGRES_USER: wikijs command: postgres -c &hellip; <a href=\"https:\/\/www.scottharvanek.com\/?p=422\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,53,1],"tags":[],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-code","category-docker","category-opensource"],"_links":{"self":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422"}],"version-history":[{"count":1,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":423,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions\/423"}],"wp:attachment":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}