Closed meetgyn closed 2 months ago
Hi @meetgyn ,
You need to make sure you use existing locations where the DB and Config are stored:
You don't need to clone the repo (unless you want to help develop / submit a PR - which is super welcome). If you want to set up NetAlertX for development, check this guide: https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEV_ENV_SETUP.md
If you only want to run the application, you only need 3 folders:
docker-compose.yml
file let's say netalertx_compose
netalertx_config
netalertx_db
In the netalertx_compose
folder, create a file called docker-compose.yml
, with the following content:
version: "3"
services:
netalertx:
container_name: netalertx
# use the below line if you want to test the latest dev image
# image: "jokobsk/netalertx-dev:latest"
image: "jokobsk/netalertx:latest"
network_mode: "host"
restart: unless-stopped
volumes:
- netalertx_config:/app/config
- netalertx_db:/app/db
# (optional) useful for debugging if you have issues setting up the container
#- local/path/logs:/app/front/log
environment:
- TZ=Europe/Berlin
- PORT=20211
you might need to change the following 2 lines so it's an absolute path, depending where these 2 folders are located:
- netalertx_config:/app/config
- netalertx_db:/app/db
then cd into the netalertx_compose
folder and run docker-compose up -d
.
Hope this helps, j
Thank you very much for your help. I am setting up the scenario you explained to me. When I ran the docker-compose, it already returned some errors that I'm trying to understand
=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) 0.0s => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 24)
=> ERROR importing cache manifest from docker.io/jokob-sk/netalertx:buildcache 3.7s => ERROR [runner 6/6] RUN /app/dockerfiles/pre-setup.sh 0.4s
importing cache manifest from docker.io/jokob-sk/netalertx:buildcache:
[runner 6/6] RUN /app/dockerfiles/pre-setup.sh: 0.380 /bin/sh: /app/dockerfiles/pre-setup.sh: not found
3 warnings found (use docker --debug to expand):
ERROR: failed to solve: process "/bin/sh -c ${INSTALL_DIR}/dockerfiles/pre-setup.sh" did not complete successfully: exit code: 127 ERROR: Service 'netalertx' failed to build : Build failed root@greenbone:/opt/projetos/NetAlertX/netaletx#
Hi,
You need to use a custom .env file with your environment variables. Do you have one? Can you post the content of it?
Also, are you trying to build the app from scratch for development? Or are you only trying to run the application?
Here is an example command I use to build the container:
sudo docker-compose --env-file ../.env up -d
My folder structure is:
- NetAlertX
- back
- config
- ...
- .env
I cd ./NetAlertX
and run the sudo docker-compose --env-file ../.env up -d
command in the folder, so it picks up the custom, environment file located in the parent directory. My .env
file looks something like this:
APP_DATA_LOCATION=/volume1/docker_appdata
DEV_LOCATION=/volume1/NetAlertX
TZ=Europe/Berlin
PORT=20211
no activity for ~2 weeks -> closing
Is there an existing issue for this?
Current Behavior
Error executing Docker commands. I am trying to use it in Docker, but without success. It is not working at all, and I need your help if possible. I am using Ubuntu 24.04.
Expected Behavior
Docker commands are not working.
Steps To Reproduce
git clone /opt/projetos/NetAlertX/ cd NetAlertX docker-compose up -d
app.conf
docker-compose.yml
What branch are you running?
Dev
app.log
no create
Debug enabled