Hakatime

WakaTime server implementation with analytics dashboard.

Directory Structure

    • .env
    • docker-compose.yml

docker-compose.yml

version: "3"
 
services:
  server:
    container_name: hakatime
    image: mujx/hakatime:v1.7.3
    environment:
      # DB settings.
      HAKA_DB_HOST: haka_db
      HAKA_DB_PORT: 5432
      HAKA_DB_NAME: test
      HAKA_DB_PASS: test
      HAKA_DB_USER: test
      # Server settings.
      # Fill out this field if the api is behind another path (e.g behind a reverse proxy).
      # This will adjust the Set-Cookie path for all the /auth related API calls.
      HAKA_API_PREFIX: ""
      # Update this with the external endpoint that you use to access hakatime.
      HAKA_BADGE_URL: "http://localhost:8080"
      HAKA_PORT: 8080
      HAKA_SHIELDS_IO_URL: "https://img.shields.io"
      HAKA_ENABLE_REGISTRATION: "true" # Toggle after you've created your account.
      # Number of hours after which inactive browser sessions will expire (login required).
      HAKA_SESSION_EXPIRY: "24"
      HAKA_LOG_LEVEL: "info" # Control the verbosity of the logger.
      HAKA_ENV: "dev" # Use a json logger for production, otherwise key=value pairs.
      HAKA_HTTP_LOG: "true" # If you want to log http requests.
      GITHUB_TOKEN: "<token>" # If you want to retrieve time spent per commit. No extra scope is required.
      # Add the following variables if you want to forward any received heartbeats to another
      # Wakatime compatible server.
      HAKA_REMOTE_WRITE_URL: "https://wakatime.com/api/v1/users/current/heartbeats.bulk"
      # You can also use this URL format to forward heartbeats to Wakapi:
      # https://[wakapi-instance]/api/compat/wakatime/v1/users/current/heartbeats.bulk
      HAKA_REMOTE_WRITE_TOKEN: "<token>"
    ports:
      # This will start the services on all interfaces. 
      # More info here: https://github.com/compose-spec/compose-spec/blob/master/spec.md#ports
      - "8080:8080"
  haka_db:
    container_name: haka_db
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: test
      POSTGRES_PASSWORD: test
      POSTGRES_USER: test
    volumes:
      - ./deploy_db_data:/var/lib/postgresql/data

Resources

GitHub: https://github.com/mujx/hakatime

Docker Hub: https://hub.docker.com/r/mujx/hakatime

Configuration: https://github.com/mujx/hakatime#deployment