Skip to content

Setting up the server

The server

The primary way to set up the server is by using the docker container hosted under codeberg.org/chaosdorf/mete-server. It has two tags and for each version a tag:

  • latest is the latest version, which can be considered stable.
  • beta is often the most up-to-date version, but may also introduce bugs and untested behaviour.

The server requires a connection to a postgres database.

Example compose
services:
  db:
    image: postgres
    container_name: metekasse-db
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
      interval: 5s
      timeout: 10s
      retries: 120

    restart: unless-stopped
    # set shared memory limit when using docker compose
    shm_size: 128mb

    volumes:
      - ./database:/var/lib/postgresql

    environment:
      POSTGRES_DB: mete
      POSTGRES_USER: mete
      POSTGRES_PASSWORD: YOUR_SUPER_SECRET_PASSWORD
  server:
    image: codeberg.org/chaosdorf/mete-server:latest
    container_name: metekasse-server
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "http://127.0.0.1:8000/health"]
      interval: 1s
      timeout: 10s
      retries: 10
    depends_on:
      db:
        condition: service_healthy
        restart: true
    ports:
      - 8000:8000

    volumes:
      - ./files:/app/files

    environment: 
      METE_DB_HOST: db
      # These have to be the same as the database!
      METE_DB_USER: mete
      METE_DB_PASSWORD: YOUR_SUPER_SECRET_PASSWORD
      METE_DB_DATABASE: mete

Configuring the database

For it to start, it requires the database connection otherwise it crashes. The parameters are set over the environment variables:

  • METE_DB_HOST and METE_DB_PORT for the host, where the database is located
  • METE_DB_USER and METE_DB_PASSWORD for the user, which the server can use.
  • METE_DB_DATABASE for the database name, the data should be stored in.

Keep in mind: METE_DB_USER should have read-write access to the METE_DB_DATABASE. It only needs CREATE access, when initially starting up. Afterwards it can be removed. Although it needs read access to the information_schema.tables and information_schema.columns tables to check for existing tables and columns.

Additional info