hi all,

want to install netalertx but i would had thought it would be just straight forward to install docker and docker compose on my ubuntu server and just run this command from the terminal

docker run -d --rm --network=host \
  -v local_path/config:/app/config \
  -v local_path/db:/app/db \
  --mount type=tmpfs,target=/app/api \
  -e PUID=200 -e PGID=300 \
  -e TZ=Europe/Berlin \
  -e PORT=20211 \
  ghcr.io/jokob-sk/netalertx:latest

am i doing something stupid

thanks,
rob

5 Spice ups

ok ive added this in file /opt/netalertx/compose.yaml

services:
  netalertx:
    container_name: netalertx
    # use the below line if you want to test the latest dev image
    # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
    image: "ghcr.io/jokob-sk/netalertx:latest"
    network_mode: "host"
    restart: unless-stopped
    volumes:
      - local_path/config:/app/config
      - local_path/db:/app/db
      # (optional) useful for debugging if you have issues setting up the container
      - local_path/logs:/app/log
      # (API: OPTION 1) use for performance
      - type: tmpfs
        target: /app/api
      # (API: OPTION 2) use when debugging issues
      # -  local_path/api:/app/api
    environment:
      - TZ=Europe/London
      - PORT=20211

now to run it i do this in the dir

docker-compose up -d

but i get errors

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 144, in get_project
    config_details = config.find(project_dir, config_path, environment, override_dir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 317, in find
    filenames = get_default_config_files(base_dir)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 353, in get_default_config_files
    (candidates, path) = find_candidates_in_parent_dirs(SUPPORTED_FILENAMES, base_dir)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 389, in find_candidates_in_parent_dirs
    if os.path.abspath(parent_dir) != os.path.abspath(path):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 423, in abspath
FileNotFoundError: [Errno 2] No such file or directory

EDIT - ive restarted and i get this now

docker-compose up -d
ERROR: Named volume "local_path/config:/app/config:rw" is used in service "netalertx" but no declaration was found in the volumes section.
root@netalertx:/opt/netalertx#
1 Spice up

sorted it

docker run -d --rm --network=host \
  -v /jokobsk/netalertx/app/config \
  -v /jokobsk/netalertx/app/db \
  --mount type=tmpfs,target=/jokobsk/netalertx/app/api \
  -e PUID=200 -e PGID=300 \
  -e TZ=Europe/London \
  -e PORT=20211 \
  ghcr.io/jokob-sk/netalertx:latest

you think its best to install via docker compose instead