mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2024-11-21 23:43:28 +01:00
commit
b47e85ab3f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,6 @@
|
||||
*.sql.gz
|
||||
.netbox
|
||||
.initializers
|
||||
.python-version
|
||||
docker-compose.override.yml
|
||||
*.pem
|
||||
configuration/*
|
||||
@ -11,5 +11,4 @@ configuration/ldap/*
|
||||
!configuration/ldap/ldap_config.py
|
||||
!configuration/logging.py
|
||||
!configuration/plugins.py
|
||||
prometheus.yml
|
||||
super-linter.log
|
||||
|
15
Dockerfile
15
Dockerfile
@ -31,8 +31,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
ARG NETBOX_PATH
|
||||
COPY ${NETBOX_PATH}/requirements.txt requirements-container.txt /
|
||||
RUN \
|
||||
# We compile 'psycopg2' in the build process
|
||||
sed -i -e '/psycopg2-binary/d' /requirements.txt && \
|
||||
# We compile 'psycopg' in the build process
|
||||
sed -i -e '/psycopg/d' /requirements.txt && \
|
||||
# Gunicorn is not needed because we use Nginx Unit
|
||||
sed -i -e '/gunicorn/d' /requirements.txt && \
|
||||
# We need 'social-auth-core[all]' in the Docker image. But if we put it in our own requirements-container.txt
|
||||
@ -62,19 +62,20 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
libldap-common \
|
||||
libpq5 \
|
||||
libxmlsec1-openssl \
|
||||
openssh-client \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-distutils \
|
||||
tini \
|
||||
&& curl -sL https://nginx.org/keys/nginx_signing.key \
|
||||
> /etc/apt/trusted.gpg.d/nginx.asc && \
|
||||
echo "deb https://packages.nginx.org/unit/ubuntu/ jammy unit" \
|
||||
&& curl --silent --output /usr/share/keyrings/nginx-keyring.gpg \
|
||||
https://unit.nginx.org/keys/nginx-keyring.gpg \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ lunar unit" \
|
||||
> /etc/apt/sources.list.d/unit.list \
|
||||
&& apt-get update -qq \
|
||||
&& apt-get install \
|
||||
--yes -qq --no-install-recommends \
|
||||
unit=1.29.1-1~jammy \
|
||||
unit-python3.10=1.29.1-1~jammy \
|
||||
unit=1.30.0-1~lunar \
|
||||
unit-python3.11=1.30.0-1~lunar \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
|
||||
|
4
build.sh
4
build.sh
@ -61,7 +61,7 @@ DOCKERFILE The name of Dockerfile to use.
|
||||
${_GREEN}Default:${_CLEAR} Dockerfile
|
||||
|
||||
DOCKER_FROM The base image to use.
|
||||
${_GREEN}Default:${_CLEAR} 'ubuntu:22.04'
|
||||
${_GREEN}Default:${_CLEAR} 'ubuntu:23.04'
|
||||
|
||||
BUILDX_PLATFORMS
|
||||
Specifies the platform(s) to build the image for.
|
||||
@ -219,7 +219,7 @@ fi
|
||||
# Determining the value for DOCKER_FROM
|
||||
###
|
||||
if [ -z "$DOCKER_FROM" ]; then
|
||||
DOCKER_FROM="docker.io/ubuntu:22.04"
|
||||
DOCKER_FROM="docker.io/ubuntu:23.04"
|
||||
fi
|
||||
|
||||
###
|
||||
|
@ -141,8 +141,11 @@ if 'CHANGELOG_RETENTION' in environ:
|
||||
CHANGELOG_RETENTION = _environ_get_and_map('CHANGELOG_RETENTION', None, _AS_INT)
|
||||
|
||||
# Maximum number of days to retain job results (scripts and reports). Set to 0 to retain job results in the database indefinitely. (Default: 90)
|
||||
if 'JOBRESULT_RETENTION' in environ:
|
||||
JOBRESULT_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT)
|
||||
if 'JOB_RETENTION' in environ:
|
||||
JOB_RETENTION = _environ_get_and_map('JOB_RETENTION', None, _AS_INT)
|
||||
# JOBRESULT_RETENTION was renamed to JOB_RETENTION in the v3.5.0 release of NetBox. For backwards compatibility, map JOBRESULT_RETENTION to JOB_RETENTION
|
||||
elif 'JOBRESULT_RETENTION' in environ:
|
||||
JOB_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT)
|
||||
|
||||
# API Cross-Origin Resource Sharing (CORS) settings. If CORS_ORIGIN_ALLOW_ALL is set to True, all origins will be
|
||||
# allowed. Otherwise, define a list of allowed origins using either CORS_ORIGIN_WHITELIST or
|
||||
@ -272,9 +275,9 @@ if 'RACK_ELEVATION_DEFAULT_UNIT_WIDTH' in environ:
|
||||
|
||||
# Remote authentication support
|
||||
REMOTE_AUTH_ENABLED = _environ_get_and_map('REMOTE_AUTH_ENABLED', 'False', _AS_BOOL)
|
||||
REMOTE_AUTH_BACKEND = environ.get('REMOTE_AUTH_BACKEND', 'netbox.authentication.RemoteUserBackend')
|
||||
REMOTE_AUTH_BACKEND = _environ_get_and_map('REMOTE_AUTH_BACKEND', 'netbox.authentication.RemoteUserBackend', _AS_LIST)
|
||||
REMOTE_AUTH_HEADER = environ.get('REMOTE_AUTH_HEADER', 'HTTP_REMOTE_USER')
|
||||
REMOTE_AUTH_AUTO_CREATE_USER = _environ_get_and_map('REMOTE_AUTH_AUTO_CREATE_USER', 'True', _AS_BOOL)
|
||||
REMOTE_AUTH_AUTO_CREATE_USER = _environ_get_and_map('REMOTE_AUTH_AUTO_CREATE_USER', 'False', _AS_BOOL)
|
||||
REMOTE_AUTH_DEFAULT_GROUPS = _environ_get_and_map('REMOTE_AUTH_DEFAULT_GROUPS', '', _AS_LIST)
|
||||
# REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
|
||||
|
||||
|
@ -12,7 +12,7 @@ services:
|
||||
env_file: env/netbox.env
|
||||
user: 'unit:root'
|
||||
volumes:
|
||||
- ./test-configuration/logging.py:/etc/netbox/config/logging.py:z,ro
|
||||
- ./test-configuration/test_config.py:/etc/netbox/config/test_config.py:z,ro
|
||||
healthcheck:
|
||||
start_period: ${NETBOX_START_PERIOD-120s}
|
||||
timeout: 3s
|
||||
|
@ -1,7 +1,7 @@
|
||||
version: '3.4'
|
||||
services:
|
||||
netbox: &netbox
|
||||
image: docker.io/netboxcommunity/netbox:${VERSION-v3.5-2.6.1}
|
||||
image: docker.io/netboxcommunity/netbox:${VERSION-v3.6-2.7.0}
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
@ -15,9 +15,9 @@ services:
|
||||
test: "curl -f http://localhost:8080/api/ || exit 1"
|
||||
volumes:
|
||||
- ./configuration:/etc/netbox/config:z,ro
|
||||
- netbox-media-files:/opt/netbox/netbox/media:z,rw
|
||||
- netbox-reports-files:/opt/netbox/netbox/reports:z,rw
|
||||
- netbox-scripts-files:/opt/netbox/netbox/scripts:z,rw
|
||||
- netbox-media-files:/opt/netbox/netbox/media:rw
|
||||
- netbox-reports-files:/opt/netbox/netbox/reports:rw
|
||||
- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
|
||||
netbox-worker:
|
||||
<<: *netbox
|
||||
depends_on:
|
||||
|
@ -51,7 +51,7 @@ exec unitd \
|
||||
--control unix:$UNIT_SOCKET \
|
||||
--pid /opt/unit/unit.pid \
|
||||
--log /dev/stdout \
|
||||
--state /opt/unit/state/ \
|
||||
--tmp /opt/unit/tmp/ \
|
||||
--statedir /opt/unit/state/ \
|
||||
--tmpdir /opt/unit/tmp/ \
|
||||
--user unit \
|
||||
--group root
|
||||
|
2
env/netbox.env
vendored
2
env/netbox.env
vendored
@ -29,6 +29,6 @@ REDIS_INSECURE_SKIP_TLS_VERIFY=false
|
||||
REDIS_PASSWORD=H733Kdjndks81
|
||||
REDIS_SSL=false
|
||||
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
|
||||
SECRET_KEY=r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X
|
||||
SECRET_KEY='r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X'
|
||||
SKIP_SUPERUSER=true
|
||||
WEBHOOKS_ENABLED=true
|
||||
|
@ -1,4 +1,5 @@
|
||||
django-auth-ldap==4.3.0
|
||||
django-auth-ldap==4.5.0
|
||||
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.13.2
|
||||
psycopg2==2.9.6
|
||||
dulwich==0.21.5
|
||||
psycopg[c,pool]==3.1.10
|
||||
python3-saml==1.15.0
|
||||
|
@ -2,3 +2,5 @@ LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': True
|
||||
}
|
||||
|
||||
DEFAULT_PERMISSIONS = {}
|
Loading…
Reference in New Issue
Block a user