Docker Installation¶
For production installation, we use Docker.
- Grab our production-ready
docker-compose.ymlfile (wget https://raw.githubusercontent.com/KryptedGaming/krypted/development/conf/docker-compose.yml) - Grab our example
.envfile (wget https://raw.githubusercontent.com/KryptedGaming/krypted/development/conf/.env) - Modify the
.envwith your desired settings - Launch your production environment with
docker-compose up -d - By default, you’ll be on port 8000. You’ll need to proxypass this on your host webserver.
Environment Variables¶
Krypted supports numerous environment variables, which are set in your .env file.
Required Environment Variables¶
| Variable | Description | Example |
|---|---|---|
DJANGO_SECRET |
Django Secret used for hashing. | aosdfiajsdufihi234h9fasd |
VERSION |
Git branch to checkout. | master |
DEBUG |
Enable Django debugging. | True or False |
SITE_DOMAIN |
The domain of your site. | auth.site.com |
SITE_TITLE |
The title of your site. | My Site |
DATABASE |
Your database preference. | SQLLITE or MYSQL |
Optional Environment Variables¶
| Variable | Description | Example |
|---|---|---|
MYSQL_DATABASE |
MYSQL Database name | db |
MYSQL_USER |
MYSQL Database user | krypted |
MYSQL_PORT |
MYSQL Database port | 3306 |
MYSQL_PASSWORD |
MYSQL Database password | mypassword |
EMAIL_HOST |
Host for your SMTP server. Enables email verification. | myemailserver.com |
EMAIL_PORT |
Port for your SMTP server. | 123 |
EMAIL_HOST_USER |
User for your SMTP server. | mail@krypted.com |
EMAIL_HOST_PASSWORD |
Password for your SMTP server. | password |
EMAIL_USE_TLS |
You'll know if you need it. | True or False |
DEFAULT_FROM_EMAIL |
You'll know if you need it. | None |
SITE_PROTOCOL |
Your transfer protocol. | http:// or https://. |
INSTALLED_APPS |
Comma separated applications to add to INSTALLED_APPS |
django_discord_connector, django_eveonline_connector |
PIP_INSTALLS |
List of pip packages, comma separated. |
package1,package2,package3 |
GIT_INSTALLS |
List of pip packages to install from GitHub, comma separated. |
KryptedGaming/django-eveonline-connector,KryptedGaming/django-discord-connector |
Example .env file¶
DJANGO_SECRET=secret
SITE_DOMAIN=localhost
SITE_TITLE=My Corporation
VERSION=development
MYSQL_DATABASE=krypted
MYSQL_USER=krypted
MYSQL_PASSWORD=somepassword
MYSQL_HOST=db
MYSQL_PORT=3306
REQUIREMENTS=KryptedGaming/django-discord-connector,KryptedGaming/django-eveonline-connector
EXTENSIONS=accounts,applications,group_requests,django_discord_connector,django_eveonline_connector
We’ll pick this apart piece by piece.
- We set the
DJANGO_SECRETtosecret, which isn’t very secure, but it’s something. All of our hashing will be done by this, so if we ever need to migrate we need this value. - We set the
SITE_DOMAINtolocalhost, meaning users will access our website by going tohttps://localhost - We set the
SITE_NAMEtoMy Corporation, which will update certain areas of the site to have our name. MYSQL_DATABASEThis is the database name that we’ll use.MYSQL_USERThis is the database user that has access to the above database.MYSQL_PASSWORDWe obviously need the password.MYSQL_HOSTDepending on where you’re hosting your MYSQL database, you’ll set this value. In this case, we’re using docker-compose and our database is a local container on the same network.MYSQL_PORTYou’ll likely not need to change this.REQUIREMENTSHere’s where the interesting part comes in. The REQUIREMENTS has two formats:<Package Name>and<GitHub User>/<Repository Name>. If we add something likedjango_eveonline_connector, pip will install it from the Python package index. If we specifyKryptedGaming/django-discord-connector, we will grab it from GitHub.- Requirements aren’t enough because some repositories will have different names. We might have a better solution in the future, but for now you need to specify all of the
EXTENSIONSto be added toINSTALLED_APPS.
Using Packages¶
Each package has their own installation settings. Refer to that package for special instructions.