Docker and Docker Compose
Familiarity with Docker and Docker Compose is required.
We simply cannot support custom scenarios or setups. Therefore, it is essential to check your device's memory limits, architecture, and CPU power.
Running FDM Monster with Docker Compose
In the next steps, we will guide you through the process of running FDM Monster with Docker Compose.
Step 1: FDM Monster image and version tag
We provide the fdmmonster/fdm-monster
image. This image requires you to run a MongoDB server, MongoDB Atlas (cloud offering), or a MongoDB docker container (see compose file below).
Find it on Docker Hub.
There are multiple tags available for the fdmmonster/fdm-monster
image.
latest
- The latest version of FDM Monster. This is the default tag.x
,x.y
,x.y.z
- A specific version of FDM Monster. For example,1
,1.4
, or1.4.0
.main
- The latest development version of FDM Monster. This version is the same as thelatest
tag and it is stable.develop
- The latest development version of FDM Monster. This version is not recommended for production use.x.y.z-rc?-1234
- A specific release candidate of FDM Monster with a specific build number. For example,1.4.0-rc1-1234
. These are development versions and are not recommended for production use.x.y.z-1234
- A specific version of FDM Monster with a specific build number. For example,1.4.0-1234
. These are development versions and are not recommended for production use.
Step 2: Create a docker-compose.yml file
To run a Docker Compose stack, create a file named docker-compose.yml
and use the file contents presented below. Note that an option has been added for adding MongoDB authentication.
If you choose not to use authentication, you can remove the MONGO_INITDB_ROOT_USERNAME
and MONGO_INITDB_ROOT_PASSWORD
environment variables.
In that case, you should leave out the <username>:<password>@
part of the MONGO
environment variable.
It's important to protect your MongoDB database with authentication. If you choose not to use authentication, you should at least use a firewall to protect your database. Do not simply expose your database over the internet without any protection! You have been warned.
There is also a development (NODE_ENV=development
) compose file here: docker-compose.yml):
version: '3.4'
services:
mongodb:
image: mongo:latest
container_name: mongodb
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
environment:
# MongoDB with authentication (advised!)
- MONGO_INITDB_ROOT_USERNAME=YOUR_ROOT_NAME
- MONGO_INITDB_ROOT_PASSWORD=YOUR_ROOT_PASSWORD
volumes:
- ./mongodb-data:/data/db
- ./mongoconfig:/data/configdb
fdm-monster:
container_name: fdm-monster
image: fdmmonster/fdm-monster:latest
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:4000 || exit 1
interval: 30s
timeout: 5s
retries: 5
start_period: 40s
depends_on:
- mongodb
ports:
- "4000:4000"
environment:
# MongoDB with and without authentication (advised!)
- MONGO=mongodb://YOUR_ROOT_NAME:YOUR_ROOT_PASSWORD@mongodb:27017/fdm-monster?authSource=admin
# - MONGO=mongodb://mongodb:27017/fdm-monster?authSource=admin
volumes:
- ./fdm-monster/media:/app/media
An example of a docker-compose.yml file with the MongoDB and FDM-Monster services in one stack.
By default the mongodb
service is not exposed to your local network. To expose MongoDB add the lines below right above the environment
line.
ports:
- "28017:27017"
Step 3: Execute the docker-compose stack
Execute this command to run the containers:
docker-compose up -d
Please note that FDM Monster requires a MongoDB database to function properly. When using the latest
or alpine
images,
make sure to configure your root user's username and password for MongoDB.
Additionally, FDM Monster needs to access the admin
table, which is the default table name for the authentication source.
Now you can access FDM Monster at http://localhost:4000
, http://127.0.0.1:4000
, or http://<your-ip>:4000
.