Production

This page explains how to run the app in production environment

Requirements

In order to properly run the application, you need at least the following installed:

  • Git
  • Docker

Installation

Start of by downloading or cloning the pdns-docker repository

git clone https://github.com/passivedns/pdns-docker.git
git clone git@github.com:passivedns/pdns-docker.git
gh repo clone passivedns/pdns-docker

Setup the database password

Before running the application, you need to change the database root password. This can be done in the pdns-docker/prod/docker-compose.yml file:

docker-compose.yml
 9
10
11
12
...
    environment:
      - ARANGO_ROOT_PASSWORD= [ADD PASSWORD HERE]
...
⚠️
Please note that if you do not setup a password, the database will be accessible freely.

Run the application

cd pdns-docker/prod
docker compose up

This should start all of the containers. If you are on MacOS and encounter any problem with the volumes while running the containers: The volume management with Docker and MacOS is a little bit tricky, so here is a simple fix: Update the file pdns-docker/prod/docker-compose.yml, by replacing the volume path with ./ instead of /.

In arango:

docker-compose.yml
 7
 8
 9
10
...
    volumes:
      - ./passivedns_arangodb:/var/lib/arangodb3
...

And in Redis:

docker-compose.yml
48
49
50
51
...
    volumes:
      - ./passivedns_redis_data:/data
...

Create an admin user

By default, the database is not initialized. You need to create an admin user in order to initialize it and be able to use the application.

Either by Docker Desktop or by CLI, in a shell of the API container :

Open the api container and go into the Exec tab.

Open a shell inside the api container:

docker exec -it api sh

This should open a new window shell.

Then, create a new admin user with:

../docker-entrypoint.sh create-user [USERNAME] [PASSWORD] --admin

Replacing [USERNAME] and [PASSWORD] with the corresponding data.

Setup the scheduler

Once the application is up and running, you can log in with the admin credentials, and you can setup a scheduler in the Users section. Once that is done, you need to update the .env file that is located in the /pdns-docker/prod/:

.env
4
5
6
7
...
SCHEDULER_USERNAME=[USERNAME]
SCHEDULER_PASSWORD=[PASSWORD]
...

Replacing [USERNAME] and [PASSWORD] with the corresponding data.

You then have to restart the scheduler container, and everything is ready!