Advertisement
txhermit

Docker-Compose: NetAlertX

Feb 17th, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.59 KB | Cybersecurity | 0 0
  1. # `docker-compose.yaml` Examples
  2.  
  3. ### Example 1
  4.  
  5. ```yaml
  6. services:
  7.   netalertx:
  8.     container_name: netalertx
  9.     # use the below line if you want to test the latest dev image
  10.     # image: "jokobsk/netalertx-dev:latest"
  11.     image: "jokobsk/netalertx:latest"      
  12.     network_mode: "host"        
  13.     restart: unless-stopped
  14.     volumes:
  15.      - local_path/config:/app/config
  16.       - local_path/db:/app/db      
  17.       # (optional) useful for debugging if you have issues setting up the container
  18.       - local_path/logs:/app/log
  19.       # (API: OPTION 1) use for performance
  20.       - type: tmpfs
  21.         target: /app/api
  22.       # (API: OPTION 2) use when debugging issues
  23.       # -  local_path/api:/app/api
  24.     environment:
  25.      - TZ=Europe/Berlin      
  26.       - PORT=20211
  27. ```
  28.  
  29. To run the container execute: `sudo docker-compose up -d`
  30.  
  31. ### Example 2
  32.  
  33. Example by [SeimuS](https://github.com/SeimusS).
  34.  
  35. ```yaml
  36.   netalertx:
  37.     container_name: NetAlertX
  38.     hostname: NetAlertX
  39.     privileged: true
  40.     # use the below line if you want to test the latest dev image
  41.     # image: "jokobsk/netalertx-dev:latest"
  42.     image: jokobsk/netalertx:latest
  43.     environment:
  44.      - TZ=Europe/Bratislava
  45.     restart: always
  46.     volumes:
  47.      - ./netalertx/db:/app/db
  48.       - ./netalertx/config:/app/config
  49.     network_mode: host
  50. ```
  51.  
  52. To run the container execute: `sudo docker-compose up -d`
  53.  
  54. ### Example 3
  55.  
  56. `docker-compose.yml`
  57.  
  58. ```yaml
  59. services:
  60.   netalertx:
  61.     container_name: netalertx
  62.     # use the below line if you want to test the latest dev image
  63.     # image: "jokobsk/netalertx-dev:latest"
  64.     image: "jokobsk/netalertx:latest"      
  65.     network_mode: "host"        
  66.     restart: unless-stopped
  67.     volumes:
  68.      - ${APP_DATA_LOCATION}/netalertx/config:/app/config
  69.       - ${APP_DATA_LOCATION}/netalertx/db/:/app/db/      
  70.       # (optional) useful for debugging if you have issues setting up the container
  71.       - ${LOGS_LOCATION}:/app/log
  72.       # (API: OPTION 1) use for performance
  73.       - type: tmpfs
  74.         target: /app/api
  75.       # (API: OPTION 2) use when debugging issues
  76.       # -  local/path/api:/app/api
  77.     environment:
  78.      - TZ=${TZ}      
  79.       - PORT=${PORT}
  80. ```
  81.  
  82. `.env` file
  83.  
  84. ```yaml
  85. #GLOBAL PATH VARIABLES
  86.  
  87. APP_DATA_LOCATION=/path/to/docker_appdata
  88. APP_CONFIG_LOCATION=/path/to/docker_config
  89. LOGS_LOCATION=/path/to/docker_logs
  90.  
  91. #ENVIRONMENT VARIABLES
  92.  
  93. TZ=Europe/Paris
  94. PORT=20211
  95.  
  96. #DEVELOPMENT VARIABLES
  97.  
  98. DEV_LOCATION=/path/to/local/source/code
  99. ```
  100.  
  101. To run the container execute: `sudo docker-compose --env-file /path/to/.env up`
  102.  
  103.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement