Skip to content

Deploying with Docker

Rodolfo Herrera Hernandez edited this page Sep 11, 2024 · 1 revision

Deploying Quantum in docker is extremely simple. However, first, you must configure the required environment variables found in the .env file within the repository. If you already did it, you can continue ;)

# NOTE: These environment variables are used in "docker-compose.yml".

# You can generate a random key for these variables in: https://randomkeygen.com/
SECRET_KEY = 
SESSION_SECRET = 

# GITHUB_CLIENT_ID: Unique identifier provided by GitHub for OAuth integration.
# GITHUB_CLIENT_SECRET: Secret key provided by GitHub for OAuth integration.
# https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authenticating-to-the-rest-api-with-an-oauth-app#registering-your-app
GITHUB_CLIENT_ID = 
GITHUB_CLIENT_SECRET = 

# Credentials that will be used to authenticate with MongoDB.
MONGO_INITDB_ROOT_USERNAME = root
MONGO_INITDB_ROOT_PASSWORD = changeme

# OPTIONAL: If you have an SMTP server, complete these variables. 
# It will serve so that, in case of errors at runtime, you will be notified (WEBMASTER_EMAIL).
SMTP_HOST =
SMTP_PORT =
SMTP_AUTH_USER =
SMTP_AUTH_PASSWORD =
WEBMASTER_MAIL =

# DOMAIN: Specifies the base domain of the server. This is the 
# main access point for the application.
DOMAIN = http://quantum-server.yourdomain.com

# CLIENT_HOST: Specifies the host of the application's 
# client. It's the access point for the user interface.
CLIENT_HOST = http://quantum.yourdomain.com

# REGISTRATION_DISABLED: The value of the variable will indicate 
# whether third parties can create accounts within the platform, that 
# is, through the client application (webui) or through the API 
# provided by the server. By default this option is "true" indicating 
# that accounts cannot be created, so the system administrator creates 
# their account as "admin" from the CLI provided.
REGISTRATION_DISABLED = false

# ...other variables that you can modify for the deployment of the 
# application in docker, you should not worry about this, since they
# have values ​​assigned by default (in docker-compose.yml).

When cloning the repository, inside the generated folder (root), you will discover the "docker-compose.yml" file, which will allow you to deploy both the backend and frontend servers using the command "docker-compose up -d --build ".

# First, you must clone the repository.
git clone -b 1.0.6 https://github.com/rodyherrera/Quantum

After cloning the repository, we go inside the generated folder to run docker-compose.

docker-compose up -d --build 

When deploying to Docker, you will have three new containers, 1) The Quantum server, 2) The web application and 3) The MongoDB instance.

By default, the backend server will run on port 80. While the web application on 5050. The database on 27020.

You shouldn't worry about the ports, but in case you have conflicts with existing services, such as port 80, you can change it and make a reverse proxy. You must do this modification within the "docker-compose.yml", and well, it also applies to the other services.