awinterstein/habitica-server

By awinterstein

Updated 1 day ago

Server component for self-hosting of Habitica.

Buildkit cache
Image
Integration & delivery
3

100K+

awinterstein/habitica-server repository overview

Self-hosting Habitica

This container can be used for self-hosting an instance of Habitica. It contains the server component, and needs a MongoDB database and optionally the web component in addition.

Source Code

Some adaptions for self-hosting and the declarations of the Docker containers are managed in a Github repository. Check it out for more documentation and for the build of the container images.

Docker Compose

A complete setup with Docker Compose could look like this:

version: "3"
services:
  server:
    image: docker.io/awinterstein/habitica-server:latest
    restart: unless-stopped
    depends_on:
      - mongo
    environment:
      - NODE_DB_URI=mongodb://mongo/habitica # this only needs to be adapted if using a separate database
      - BASE_URL=http://127.0.0.1:3000 # change this to the URL under which your instance will be reachable
      - INVITE_ONLY=false # change to `true` after registration of initial users, to restrict further registrations
      - EMAIL_SERVER_URL=mail.example.com
      - EMAIL_SERVER_PORT=587
      - EMAIL_SERVER_AUTH_USER=mail_user
      - EMAIL_SERVER_AUTH_PASSWORD=mail_password
    ports:
      - "3000:3000"
    networks:
      - habitica
  mongo:
    image: docker.io/mongo:latest
    restart: unless-stopped
    command: ["--bind_ip_all", "--port", "27017"]
    healthcheck:
      test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
      interval: 10s
      timeout: 5s
      start_period: 5s
      retries: 3
    volumes:
      - ./mongodb-data/db:/data/db:rw
      - ./mongodb-data/dbconf:/data/configdb
    networks:
      habitica:
        aliases:
          - mongo
networks:
  habitica:
    driver: bridge

Habitica can be reached on http://localhost:3000 then.

Tag summary

Content type

Buildkit_cache

Digest

sha256:3451c85a2

Size

1.9 GB

Last updated

1 day ago

docker pull awinterstein/habitica-server:buildcache