Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New docker setup and no jobs running #60

Closed
huntson opened this issue Nov 23, 2023 · 3 comments
Closed

New docker setup and no jobs running #60

huntson opened this issue Nov 23, 2023 · 3 comments

Comments

@huntson
Copy link

huntson commented Nov 23, 2023

I'm running Netdisco in a docker on a system (first time) and no jobs appear to be running; they all show as queued. I've seen references to CRON jobs and ensuring they are running when looking up how to solve this however I'm not quite sure how to deal with that in the Docker environment.

See the compose file I used below:

`version: '2.3'
services:

netdisco-postgresql:
image: netdisco/netdisco:latest-postgresql
volumes:
- "/volume1/docker/netdisco/pgdata:/var/lib/postgresql/data"
restart: always

netdisco-backend:
image: netdisco/netdisco:latest-backend
volumes:
- "/volume1/docker/netdisco/nd-site-local:/home/netdisco/nd-site-local"
- "/volume1/docker/netdisco/config:/home/netdisco/environments"
- "/volume1/docker/netdisco/logs:/home/netdisco/logs"
environment:
NETDISCO_DOMAIN: discover
NETDISCO_DB_HOST: netdisco-postgresql
depends_on:
- netdisco-postgresql
dns_opt:
- 'ndots:0'
- 'timeout:1'
- 'retries:0'
- 'attempts:1'
- edns0
- trustad
restart: always

netdisco-web:
image: netdisco/netdisco:latest-web
volumes:
- "/volume1/docker/netdisco/nd-site-local:/home/netdisco/nd-site-local"
- "/volume1/docker/netdisco/config:/home/netdisco/environments"
environment:
NETDISCO_DOMAIN: discover
NETDISCO_DB_HOST: netdisco-postgresql
IPV: 4
ports:
- "4999:5000"
depends_on:
- netdisco-postgresql
dns_opt:
- 'ndots:0'
- 'timeout:1'
- 'retries:0'
- 'attempts:1'
- edns0
- trustad
restart: always

netdisco-do:
image: netdisco/netdisco:latest-do
volumes:
- "/volume1/docker/netdisco/nd-site-local:/home/netdisco/nd-site-local"
- "/volume1/docker/netdisco/config:/home/netdisco/environments"
environment:
NETDISCO_DOMAIN: discover
NETDISCO_DB_HOST: netdisco-postgresql
depends_on:
- netdisco-postgresql
profiles:
- cli-manual
`

@huntson
Copy link
Author

huntson commented Nov 23, 2023

Getting these:

Failed to open STDOUT to /home/netdisco/logs/netdisco-backend.log: Permission denied at /home/netdisco/perl5/lib/perl5/Daemon/Control.pm line 197.

I wound up chowning the directory to allow everyone to read and write and this seemed to get the docker working and getting data. That being said, this is a silly solution as it is not the most security conscious one. I attempted to add the PUID and PGID variables to the environment however this did not work either. Any ideas how we can get the docker to start with the appropriate permissions without having to open up the directory to everyone?

@rc9000
Copy link
Member

rc9000 commented Nov 23, 2023

The first bit of the README.md addresses that:

The containers need some directories present in the mounted volume. In a directory of your choice, 
create this structure and allow the netdisco uid in the container (901) to write into it:

cd $directory_of_your_choice
mkdir -p netdisco/{logs,config,nd-site-local} 
sudo chown -R 901:901 netdisco

This is what we have for now, there is also #52 that proposes to use volumes instead. It would be nice to have a setup that uses less of this interaction between container and host, and maybe also addresses other popular container environments like k8s or podman, but at the moment AFAIK nobody is working on it.

@huntson
Copy link
Author

huntson commented Jan 2, 2024

Thank you for your help with this. I am certain when I revisit it this will solve my issue.

@ollyg ollyg closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants