Skip to main content
Version: 7.0

Authorization configuration in Docker

Creating backup and clearing MongoDB data

Creating backup

Navigate to the root directory of the Passwork installation:

cd /<passwork>/

Run the backup creation script:

./db-backup.sh

Clearing collections and data

danger

Please ensure that the backup was created correctly before proceeding further.

Stop and remove the passwork_db container:

  docker compose down db --volumes

Creating MongoDB user and starting container

Creating user

Edit and supplement the .env variables file. Insert the following lines and substitute your own values:

# Database username during initialization.
MONGO_INITDB_ROOT_USERNAME=adminuser
# Database user password during initialization.
MONGO_INITDB_ROOT_PASSWORD=password
danger

The following characters are prohibited in the username and password as they may cause connection failures to MongoDB: . @ $ : % " ' / \ |

Starting container

Start the passwork_db container:

docker compose up -d db

Check the running container:

docker ps | grep passwork_db

Restoring from backups and connecting Passwork

Restoring databases

Run the restore script:

./db-restore.sh

Specify the backup created in the first step:

Enter the backup file name to restore: mongo-xxxx-xx-xx-xx:xx:xx.dump

Verify connection to MongoDB with authorization:

docker exec -it passwork_db mongosh "mongodb://adminuser:password@localhost:27017"

Configuring and connecting Passwork with authorization

Edit the Passwork configuration file /<passwork>/conf/keys/config.env:

MONGODB_USERNAME=adminuser
MONGODB_PASSWORD=password

Save the changes and refresh the Passwork page to verify connection with MongoDB authorization.