Network to Code has an existing published Nautobot Docker Image on Docker Hub. See here. This project uses Docker Compose. The Docker compose file in this project pulls that Nautobot Docker image using the latest stable Nautobot release along with several other Docker images required for Nautobot to function. See the diagram below. This project is for those looking for a multi-container single-node install for Nautobot often coupled with backup & HA capabilities from their hypervisor manager.
By default, this project deploys the Nautobot application, a single worker container, Redis containers, and PostgresQL. It does not deploy NGINX, SSL, or any Nautobot plugins, . However, the project is extensible to allow users to tailor to their specific requirements. For example, if you need to deploy SSL or plugins, see the docs linked. The web server used on the application is pyuwsgi.
There are two variables that should be set for the Docker-Compose file. The following table covers the environment variables, default setting, and what it does.
Environment Variable | Default | Notes |
---|---|---|
PYTHON_VER | 3.9 | This sets the Python version within the container version. 3.6 - 3.9 are initially supported |
NAUTOBOT_IMAGE | 1.2.4 | The version of Nautobot to use in the container image |
This docker-compose includes the Celery worker that was introduced with Nautobot 1.1.0. Please comment out or remove the celery worker in the docker-compose.yml
if you are using a pre-1.1.0 release.
The provided Docker Compose makes use of environment variables to control what is to be used. This is tightly coupled with the Docker image that is provided on Docker Hub.
The installation of plugins has a slightly more involved getting started process. See see the Plugin documentation..
git clone https://github.com/nautobot/nautobot-docker-compose.git
cd nautobot-docker-compose
local.env.example
to local.env
cp local.env.example local.env
.env
file for your environment. THESE SHOULD BE CHANGED for proper security!vi local.env
.env
to be only available for the current userchmod 0600 local.env
docker-compose up
to start the environmentdocker-compose up
The Docker container has a Docker entrypoint script that allows you to create a super user by the usage of Environment variables. This can be done by updating the example .env
file environment option of NAUTOBOT_CREATE_SUPERUSER
to True
. This will then use the information supplied to create the super user.
After the containers have started:
docker container ls
Example Output:
❯ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
143f10daa229 networktocode/nautobot:latest "nautobot-server rqw…" 2 minutes ago Up 2 minutes (healthy) nautobot-docker-compose_nautobot-worker_1
bb29124d7acb networktocode/nautobot:latest "/docker-entrypoint.…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp nautobot-docker-compose_nautobot_1
ad57ac1749b3 redis:alpine "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 6379/tcp nautobot-docker-compose_redis-queue_1
5ab83264e6fe postgres:10 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 5432/tcp nautobot-docker-compose_postgres_1
a9ec61ce5e30 redis:alpine "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 6379/tcp nautobot-docker-compose_redis-cacheops_1
a84a89169300 76e40881ecc6 "docker-entrypoint.s…" 5 weeks ago Up 5 hours 5432/tcp nautobot_plugin_chatops_ansible_postgres_1
60ef800be813 redis:5-alpine "docker-entrypoint.s…" 5 weeks ago Up 5 hours 6379/tcp nautobot_plugin_chatops_ansible_redis_1
nautobot-docker-compose_nautobot_1
container as indicated by the name in the last column for the Nautobot container that has ports listeddocker exec -it nautobot-docker-compose_nautobot_1 bash
nautobot-server createsuperuser
Example Prompts:
nautobot@bb29124d7acb:~$ nautobot-server createsuperuser
Username: administrator
Email address:
Password:
Password (again):
Superuser created successfully.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。